]> git.sesse.net Git - vlc/commitdiff
Qt4: activate playlist item on right click (fix #2749)
authorRémi Denis-Courmont <remi@remlab.net>
Thu, 21 May 2009 18:32:02 +0000 (21:32 +0300)
committerRémi Denis-Courmont <remi@remlab.net>
Thu, 21 May 2009 18:33:25 +0000 (21:33 +0300)
Also, show the popup menu on press rather than release.

modules/gui/qt4/util/customwidgets.hpp

index d1f1f74809fe72f199e58507ea2a52763f1d62e5..ea5b3309a1b84470b51e15899a33581ca98245fd 100644 (file)
@@ -93,15 +93,18 @@ public:
     void mouseReleaseEvent( QMouseEvent* e )
     {
         if( e->button() & Qt::RightButton )
-        {
-            emit rightClicked( indexAt( QPoint( e->x(), e->y() ) ),
-                               QCursor::pos() );
-        }
+            return; /* Do NOT forward to QTreeView!! */
         QTreeView::mouseReleaseEvent( e );
     }
 
     void mousePressEvent( QMouseEvent* e )
     {
+        if( e->button() & Qt::RightButton )
+        {
+            emit rightClicked( indexAt( QPoint( e->x(), e->y() ) ),
+                               QCursor::pos() );
+            return;
+        }
         if( e->button() & Qt::LeftButton )
         {
             if( !indexAt( QPoint( e->x(), e->y() ) ).isValid() )