[vlc-devel] commit: Qt: code simplification and usage simplification for SpeedLabel ( Jean-Baptiste Kempf )
git version control
git at videolan.org
Wed Feb 11 20:19:45 CET 2009
vlc | branch: master | Jean-Baptiste Kempf <jb at videolan.org> | Wed Feb 11 20:18:33 2009 +0100| [40352944d62388fe9a7da6a99a700eb2e1bcbb4d] | committer: Jean-Baptiste Kempf
Qt: code simplification and usage simplification for SpeedLabel
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>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=40352944d62388fe9a7da6a99a700eb2e1bcbb4d
---
modules/gui/qt4/components/interface_widgets.cpp | 9 ++-------
modules/gui/qt4/components/interface_widgets.hpp | 5 ++---
2 files changed, 4 insertions(+), 10 deletions(-)
diff --git a/modules/gui/qt4/components/interface_widgets.cpp b/modules/gui/qt4/components/interface_widgets.cpp
index a57cae1..7249022 100644
--- a/modules/gui/qt4/components/interface_widgets.cpp
+++ b/modules/gui/qt4/components/interface_widgets.cpp
@@ -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()
{
diff --git a/modules/gui/qt4/components/interface_widgets.hpp b/modules/gui/qt4/components/interface_widgets.hpp
index 206c579..3b7d01b 100644
--- a/modules/gui/qt4/components/interface_widgets.hpp
+++ b/modules/gui/qt4/components/interface_widgets.hpp
@@ -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 );
More information about the vlc-devel
mailing list