From kde-commits Wed Dec 07 02:47:20 2005 From: George Staikos Date: Wed, 07 Dec 2005 02:47:20 +0000 To: kde-commits Subject: extragear/graphics/kst/kst Message-Id: <1133923640.960106.4638.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=113392364718834 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 KstObjectList > findChildrenType(bool recursive = false);