]> cloud.milkyroute.net Git - dolphin.git/commitdiff
When the selection toggle is clicked and the mouse gets moved outside the selection...
authorPeter Penz <peter.penz19@gmail.com>
Tue, 17 Feb 2009 17:12:31 +0000 (17:12 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 17 Feb 2009 17:12:31 +0000 (17:12 +0000)
BUG: 184178

svn path=/trunk/KDE/kdebase/apps/; revision=927488

src/selectiontoggle.cpp

index b9b79def01af8f2834936e2e85909ccac59d03c7..01cfed0f3d80c49c239cb27d7c35eed9b28c87d6 100644 (file)
@@ -89,9 +89,27 @@ void SelectionToggle::setVisible(bool visible)
 
 bool SelectionToggle::eventFilter(QObject* obj, QEvent* event)
 {
-    if ((obj == parent()) && (event->type() == QEvent::Leave)) {
-        hide();
+    if (obj == parent()) {
+        switch (event->type()) {
+        case QEvent::Leave:
+            hide();
+            break;
+
+        case QEvent::MouseMove:
+            if (m_isHovered) {
+                // Don't forward mouse move events to the viewport,
+                // otherwise a rubberband selection will be shown when
+                // clicking on the selection toggle and moving the mouse
+                // above the viewport.
+                return true;
+            }
+            break;
+
+        default:
+            break;
+        }
     }
+
     return QAbstractButton::eventFilter(obj, event);
 }