[Kst] extragear/graphics/kst/kst
George Staikos
staikos at kde.org
Wed Dec 7 03:47:20 CET 2005
SVN commit 486204 by staikos:
It's possible to select and move child objects now. However they don't leave
gracefully yet.
M +3 -3 ksttoplevelview.cpp
M +15 -0 kstviewobject.cpp
M +1 -0 kstviewobject.h
--- trunk/extragear/graphics/kst/kst/ksttoplevelview.cpp #486203:486204
@@ -226,7 +226,7 @@
//TODO: make this work better with click-select mode
- KstViewObjectPtr p = findChild(pos, false);
+ KstViewObjectPtr p = findDeepestChild(pos, false);
if (p) {
setCursorFor(pos, p);
if (p->focused()) {
@@ -340,7 +340,7 @@
//kstdDebug() << "HANDLE PRESS" << endl;
_pressDirection = -1;
- _pressTarget = findChild(pos, false);
+ _pressTarget = findDeepestChild(pos, false);
if (_mode != LayoutMode && !_pressTarget) {
_pressTarget = 0L;
@@ -1043,7 +1043,7 @@
bool KstTopLevelView::popupMenu(KPopupMenu *menu, const QPoint& pos) {
bool rc = false;
// Want to clear focus without repaint
- _pressTarget = findChild(pos, false);
+ _pressTarget = findDeepestChild(pos, false);
if (_focusOn) {
_pressDirection = -1;
--- trunk/extragear/graphics/kst/kst/kstviewobject.cpp #486203:486204
@@ -795,6 +795,21 @@
}
+KstViewObjectPtr KstViewObject::findDeepestChild(const QPoint& pos, bool borderForTransparent) {
+ KstViewObjectPtr obj = findChild(pos, borderForTransparent);
+ if (obj) {
+ KstViewObjectPtr c;
+ do {
+ c = obj->findDeepestChild(pos, borderForTransparent);
+ if (c) {
+ obj = c;
+ }
+ } while (c);
+ }
+ return obj;
+}
+
+
KstViewObjectPtr KstViewObject::findChild(const QPoint& pos, bool borderForTransparent) {
KstViewObjectPtr obj;
--- trunk/extragear/graphics/kst/kst/kstviewobject.h #486203:486204
@@ -119,6 +119,7 @@
// split it into two methods eventually. The bool is for toplevelview so
// that it can do resize rect on transparent objects
KstViewObjectPtr findChild(const QPoint& pos, bool borderForTransparent = false);
+ KstViewObjectPtr findDeepestChild(const QPoint& pos, bool borderForTransparent = false);
KstViewObjectPtr findChild(const QString& name, bool recursive = true);
bool contains(const KstViewObjectPtr child) const;
template<class T> KstObjectList<KstSharedPtr<T> > findChildrenType(bool recursive = false);
More information about the Kst
mailing list