[vlc-commits] Qt: do not react to right-click to mute volume

Jean-Baptiste Kempf git at videolan.org
Sat Dec 17 05:25:07 CET 2011


vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Sat Dec 17 05:24:03 2011 +0100| [7dab7f2f285f99c78f5aca3802a787f8b369e4c1] | committer: Jean-Baptiste Kempf

Qt: do not react to right-click to mute volume

This is counter-intuitive.
As asked by etix

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=7dab7f2f285f99c78f5aca3802a787f8b369e4c1
---

 modules/gui/qt4/components/controller_widget.cpp |   30 +++++++++++-----------
 1 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/modules/gui/qt4/components/controller_widget.cpp b/modules/gui/qt4/components/controller_widget.cpp
index 4bd588b..acd8b7f 100644
--- a/modules/gui/qt4/components/controller_widget.cpp
+++ b/modules/gui/qt4/components/controller_widget.cpp
@@ -210,25 +210,25 @@ void SoundWidget::setMuted( bool mute )
 bool SoundWidget::eventFilter( QObject *obj, QEvent *e )
 {
     VLC_UNUSED( obj );
-    if (e->type() == QEvent::MouseButtonPress  )
+    if( e->type() == QEvent::MouseButtonPress )
     {
-        if( volumeSlider->orientation() ==  Qt::Vertical )
+        QMouseEvent *event = static_cast<QMouseEvent*>(e);
+        if( event->button() != Qt::RightButton )
         {
-            QMouseEvent *event = static_cast<QMouseEvent*>(e);
-            showVolumeMenu( event->pos() );
+            if( volumeSlider->orientation() ==  Qt::Vertical )
+            {
+                showVolumeMenu( event->pos() );
+            }
+            else
+            {
+                setMuted( !b_is_muted );
+            }
+            e->accept();
+            return true;
         }
-        else
-        {
-            setMuted( !b_is_muted );
-        }
-        e->accept();
-        return true;
-    }
-    else
-    {
-        e->ignore();
-        return false;
     }
+    e->ignore();
+    return false;
 }
 
 /**



More information about the vlc-commits mailing list