]> git.sesse.net Git - vlc/commitdiff
Qt: code simplification and usage simplification for SpeedLabel
authorJean-Baptiste Kempf <jb@videolan.org>
Wed, 11 Feb 2009 19:18:33 +0000 (20:18 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Wed, 11 Feb 2009 19:18:33 +0000 (20:18 +0100)
Clicking on it brings the adjustable slider.
DoubleClicking doesn't do anything anymore.

This way the behaviour is more usable and less complex <joke>(don't be too KDEish!)</joke>

modules/gui/qt4/components/interface_widgets.cpp
modules/gui/qt4/components/interface_widgets.hpp

index a57cae171032d56cac4334340d4b6466b8ca32fd..72490223561ad318a72b20bdba9f28816ed811be 100644 (file)
@@ -284,8 +284,7 @@ SpeedLabel::SpeedLabel( intf_thread_t *_p_intf, const QString& text,
                         QWidget *parent )
            : QLabel( text, parent ), p_intf( _p_intf )
 {
-    setToolTip( qtr( "Current playback speed.\nRight click to adjust" ) );
-    setContextMenuPolicy ( Qt::CustomContextMenu );
+    setToolTip( qtr( "Current playback speed.\nClick to adjust" ) );
 
     /* Create the Speed Control Widget */
     speedControl = new SpeedControlWidget( p_intf, this );
@@ -295,16 +294,12 @@ SpeedLabel::SpeedLabel( intf_thread_t *_p_intf, const QString& text,
     widgetAction->setDefaultWidget( speedControl );
     speedControlMenu->addAction( widgetAction );
 
-    /* Speed Label behaviour:
-       - right click gives the vertical speed slider */
-    CONNECT( this, customContextMenuRequested( QPoint ),
-             this, showSpeedMenu( QPoint ) );
-
     /* Change the SpeedRate in the Status Bar */
     CONNECT( THEMIM->getIM(), rateChanged( int ), this, setRate( int ) );
 
     CONNECT( THEMIM, inputChanged( input_thread_t * ),
              speedControl, activateOnState() );
+
 }
 SpeedLabel::~SpeedLabel()
 {
index 206c57913d3197dbe3924033dcc77d396874c70e..3b7d01b403b0a1075d2f4c96909a2a9d0a39ec8c 100644 (file)
@@ -160,10 +160,9 @@ public:
     virtual ~SpeedLabel();
 
 protected:
-    virtual void mouseDoubleClickEvent ( QMouseEvent * event )
+    virtual void mousePressEvent ( QMouseEvent * event )
     {
-        event->accept();
-        THEMIM->getIM()->setRate( INPUT_RATE_DEFAULT );
+        showSpeedMenu( event->pos() );
     }
 private slots:
     void showSpeedMenu( QPoint );