Commit 66803298 authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: ExtToolButton: set delay relatively to dblclick's

parent ef77c313
......@@ -36,6 +36,7 @@
#include <QKeyEvent>
#include <QWheelEvent>
#include <QPixmap>
#include <QApplication>
#include <vlc_keys.h>
QFramelessButton::QFramelessButton( QWidget *parent )
......@@ -415,7 +416,8 @@ SpinningIcon::~SpinningIcon()
QToolButtonExt::QToolButtonExt(QWidget *parent, int ms ): longClick( false )
{
setAutoRepeat( true );
setAutoRepeatDelay( ms );
/* default to twice the doubleclick delay */
setAutoRepeatDelay( ( ms > 0 )? ms : 2 * QApplication::doubleClickInterval() );
setAutoRepeatInterval( 100 );
connect( this, SIGNAL(released()), this, SLOT(releasedSlot()) );
}
......
......@@ -52,7 +52,7 @@ class QToolButtonExt : public QToolButton
{
Q_OBJECT
public:
QToolButtonExt( QWidget *parent = 0, int ms = 1000 );
QToolButtonExt( QWidget *parent = 0, int ms = 0 );
private:
bool longClick;
private slots:
......
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