Commit f6aab8b8 authored by Jean-Baptiste Kempf's avatar Jean-Baptiste Kempf

Qt4 - Actually implement double-click on speed does reset the speed... Don't laugh...

parent 5df9c323
...@@ -839,11 +839,6 @@ void SpeedControlWidget::setEnable( bool b_enable ) ...@@ -839,11 +839,6 @@ void SpeedControlWidget::setEnable( bool b_enable )
speedSlider->setEnabled( b_enable ); speedSlider->setEnabled( b_enable );
} }
void SpeedControlWidget::mouseDoubleClickEvent( QMouseEvent * event )
{
resetRate();
}
#define RATE_SLIDER_MAXIMUM 3.0 #define RATE_SLIDER_MAXIMUM 3.0
#define RATE_SLIDER_MINIMUM 0.3 #define RATE_SLIDER_MINIMUM 0.3
#define RATE_SLIDER_LENGTH 100.0 #define RATE_SLIDER_LENGTH 100.0
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "qt4.hpp" #include "qt4.hpp"
#include "main_interface.hpp" #include "main_interface.hpp"
#include "input_manager.hpp"
#include <QWidget> #include <QWidget>
#include <QFrame> #include <QFrame>
...@@ -238,6 +239,21 @@ signals: ...@@ -238,6 +239,21 @@ signals:
void timeLabelDoubleClicked(); void timeLabelDoubleClicked();
}; };
class SpeedLabel : public QLabel
{
Q_OBJECT
public:
SpeedLabel( intf_thread_t *_p_intf, const QString text ): QLabel( text)
{ p_intf = _p_intf; }
protected:
virtual void mouseDoubleClickEvent ( QMouseEvent * event )
{
THEMIM->getIM()->setRate( INPUT_RATE_DEFAULT );
}
private:
intf_thread_t *p_intf;
};
/******************** Speed Control Widgets ****************/ /******************** Speed Control Widgets ****************/
class SpeedControlWidget : public QFrame class SpeedControlWidget : public QFrame
...@@ -247,8 +263,6 @@ public: ...@@ -247,8 +263,6 @@ public:
SpeedControlWidget( intf_thread_t *); SpeedControlWidget( intf_thread_t *);
virtual ~SpeedControlWidget(); virtual ~SpeedControlWidget();
void updateControls( int ); void updateControls( int );
protected:
virtual void mouseDoubleClickEvent( QMouseEvent * event );
private: private:
intf_thread_t *p_intf; intf_thread_t *p_intf;
QSlider *speedSlider; QSlider *speedSlider;
......
...@@ -324,7 +324,7 @@ inline void MainInterface::createStatusBar() ...@@ -324,7 +324,7 @@ inline void MainInterface::createStatusBar()
nameLabel = new QLabel; nameLabel = new QLabel;
nameLabel->setTextInteractionFlags( Qt::TextSelectableByMouse nameLabel->setTextInteractionFlags( Qt::TextSelectableByMouse
| Qt::TextSelectableByKeyboard ); | Qt::TextSelectableByKeyboard );
speedLabel = new QLabel( "1.00x" ); speedLabel = new SpeedLabel( p_intf, "1.00x" );
speedLabel->setContextMenuPolicy ( Qt::CustomContextMenu ); speedLabel->setContextMenuPolicy ( Qt::CustomContextMenu );
/* Styling those labels */ /* Styling those labels */
......
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