Commit 40352944 authored by Jean-Baptiste Kempf's avatar 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>
parent 35103a19
......@@ -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()
{
......
......@@ -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 );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment