[Kst] extragear/graphics/kst/kst
George Staikos
staikos at kde.org
Thu Feb 2 18:37:47 CET 2006
SVN commit 504965 by staikos:
make click-for-label work again
M +11 -1 kstgfxtextmousehandler.cpp
--- trunk/extragear/graphics/kst/kst/kstgfxtextmousehandler.cpp #504964:504965
@@ -22,6 +22,7 @@
#include "kstgfxtextmousehandler.h"
#include "kstgfxmousehandlerutils.h"
#include "kst.h"
+#include "ksdebug.h"
#include "kstdoc.h"
#include "kstviewlabel.h"
#include "kstviewwidget.h"
@@ -88,6 +89,7 @@
label->move(pos);
}
+ bool wasClick = size == QSize(0, 0);
if (size.width() < 3) {
size.setWidth(3);
}
@@ -97,10 +99,18 @@
label->resize(size);
if (label->showDialog(view, true)) {
- KstViewObjectPtr container = view->findDeepestChild(_prevBand);
+ KstViewObjectPtr container;
+ if (wasClick) {
+ container = view->findDeepestChild(pos);
+ } else {
+ container = view->findDeepestChild(_prevBand);
+ }
if (!container) {
container = view;
}
+ if (wasClick) {
+ label->adjustSizeForText(container->contentsRect());
+ }
container->appendChild(KstViewObjectPtr(label));
KstApp::inst()->document()->setModified();
}
More information about the Kst
mailing list