[Kst] kdeextragear-2/kst/kst

George Staikos staikos at kde.org
Tue Apr 6 22:24:09 CEST 2004


CVS commit by staikos: 

allow moving of objects


  M +5 -7      ksttoplevelview.cpp   1.13
  M +1 -0      ksttoplevelview.h   1.9


--- kdeextragear-2/kst/kst/ksttoplevelview.cpp  #1.12:1.13
@@ -195,13 +195,11 @@ bool KstTopLevelView::handlePress(const 
   }
   
-  // To avoid a useless findChild()
-  if (_cursor.shape() == Qt::SizeAllCursor) {
-    _pressTarget = 0;
-    return false;
-  }
-
   _pressTarget = findChild(pos);
   assert(_pressTarget);
   _pressDirection = directionFor(pos, _pressTarget->geometry());
+  if (_pressDirection == 0) {
+    _moveOffset = pos - _pressTarget->position();
+  }
+
   _pressTarget->setFocus(false);
 
@@ -284,5 +282,5 @@ void KstTopLevelView::releasePress(const
         break;
       default:
-        abort();
+        _pressTarget->move(pos - _moveOffset);
         break;
     }

--- kdeextragear-2/kst/kst/ksttoplevelview.h  #1.8:1.9
@@ -65,4 +65,5 @@ class KstTopLevelView : public KstViewOb
     char _pressDirection;
     QCursor _cursor;
+    QPoint _moveOffset;
     KstViewObjectPtr _pressTarget;
 };





More information about the Kst mailing list