Bug 117838 - difficult to determine new parent during drag
Summary: difficult to determine new parent during drag
Status: RESOLVED FIXED
Alias: None
Product: kst
Classification: Applications
Component: view objects (show other bugs)
Version: 1.x
Platform: Compiled Sources Linux
: NOR wishlist
Target Milestone: ---
Assignee: kst
URL:
Keywords:
: 120789 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-12-07 07:47 UTC by George Staikos
Modified: 2010-08-14 14:40 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description George Staikos 2005-12-07 07:47:01 UTC
It's difficult to determine the new parent of an object that is moved.  We 
should draw a target indicator when an object is hovered over it's potential 
new parent.  This is a 1.2.1/1.3 item due to the potential performance and 
painting bugs it can cause.  We need to be sure this doesn't cause a 
performance loss, especially in realtime mode.
Comment 1 Andrew Walker 2006-01-26 19:48:27 UTC
Should be fixed for 1.2.1 release
Comment 2 George Staikos 2006-01-30 18:48:36 UTC
*** Bug 120789 has been marked as a duplicate of this bug. ***
Comment 3 Andrew Walker 2007-09-06 22:26:49 UTC
SVN commit 709209 by arwalker:

BUG:117838 highlight the prospective parent of an object during a move operation. This is necessary as the automatic parenting feature is not necessarily intuitive and this makes it more obvious

 M  +19 -1     ksttoplevelview.cpp  
 M  +5 -4      ksttoplevelview.h  


--- branches/work/kst/1.5/kst/src/libkstapp/ksttoplevelview.cpp #709208:709209
@@ -834,7 +834,7 @@
     p.setPen(QPen(Qt::black, 0, Qt::DotLine));
     if (_selectionList.isEmpty()) {
       if (old.topLeft() != QPoint(-1, -1)) {
-        _pressTarget->drawShadow(p, old.topLeft());  
+        _pressTarget->drawShadow(p, old.topLeft());
       }
       _pressTarget->drawShadow(p, r.topLeft());
     } else {
@@ -845,6 +845,22 @@
         (*iter)->drawShadow(p, r.topLeft() + (*iter)->geometry().topLeft() - originalTopLeft);
       }
     }
+
+    //
+    // draw a selection for the new parent if the _pressTarget is released now...
+    //
+    KstViewObjectPtr container = findDeepestChild(r);
+
+    if (container != _prevContainer) {
+      if (_prevContainer) {
+        _prevContainer->drawShadow(p, _prevContainer->geometry().topLeft());
+      }
+      if (container) {
+        container->drawShadow(p, container->geometry().topLeft());
+      }
+      _prevContainer = container;
+    }
+
     p.end();
   }
 }
@@ -998,6 +1014,7 @@
     // selecting objects using rubber band
     releasePressLayoutModeSelect(pos, shift);
   }
+  _prevContainer = 0L;
   _pressTarget = 0L;
   _pressDirection = -1;
   _moveOffset = QPoint(-1, -1);
@@ -1742,6 +1759,7 @@
     }
     //_pressTarget = 0L;
     _prevBand = QRect(-1, -1, 0, 0);
+    _prevContainer = 0L;
     return;
   }
 
--- branches/work/kst/1.5/kst/src/libkstapp/ksttoplevelview.h #709208:709209
@@ -102,7 +102,7 @@
     void updateFocus(const QPoint& pos);
     bool handlePress(const QPoint& pos, bool shift = false);
     bool handleDoubleClick(const QPoint& pos, bool shift = false);
-    
+
     // press move handlers
     void pressMove(const QPoint& pos, bool shift = false, bool alt = false);
     void pressMoveLayoutMode(const QPoint& pos, bool shift = false, bool alt = false);
@@ -112,7 +112,7 @@
     void pressMoveLayoutModeSelect(const QPoint& pos);
     void pressMoveLayoutModeEndPoint(const QPoint& pos, bool maintainAspect = false, bool snapToBorder = true);
     void pressMoveLayoutModeCenteredResize(const QPoint& pos, bool maintainAspect = false, bool snapToBorder = true);
-    
+
     // release press handlers 
     void releasePress(const QPoint& pos, bool shift = false);
     void releasePressLayoutMode(const QPoint& pos, bool shift = false);
@@ -138,7 +138,7 @@
     QPoint pointSnapToObjects(const QPoint& p);
     // Called as a response to drag re-entering widget()
     void restartMove();
-    
+
     KstGfxMouseHandler *handlerForObject(const QString& objType);
 
   private:
@@ -157,6 +157,7 @@
     QPoint _moveOffset;
     QPoint _moveOffsetSticky;
     KstViewObjectPtr _pressTarget, _hoverFocus;
+    KstViewObjectPtr _prevContainer;
     QRect _prevBand;
     KstViewObjectList _selectionList;
     KstViewObjectPtr _mouseGrabber;
@@ -233,4 +234,4 @@
 
 
 #endif
-// vim: ts=2 sw=2 et
+
Comment 4 Peter Kümmel 2010-08-14 14:40:50 UTC
Change version to 1.x