Commit a587c752 authored by François Cartegnie's avatar François Cartegnie 🤞

Qt: trigger epg on program doubleclick

parent e6d4348b
......@@ -550,7 +550,7 @@ void CoverArtLabel::askForUpdate()
}
TimeLabel::TimeLabel( intf_thread_t *_p_intf, TimeLabel::Display _displayType )
: QLabel(), p_intf( _p_intf ), bufTimer( new QTimer(this) ),
: ClickableQLabel(), p_intf( _p_intf ), bufTimer( new QTimer(this) ),
buffering( false ), showBuffering(false), bufVal( -1 ), displayType( _displayType )
{
b_remainingTime = false;
......
......@@ -118,7 +118,20 @@ private slots:
};
#endif
class TimeLabel : public QLabel
class ClickableQLabel : public QLabel
{
Q_OBJECT
public:
virtual void mouseDoubleClickEvent( QMouseEvent *event )
{
Q_UNUSED( event );
emit doubleClicked();
}
signals:
void doubleClicked();
};
class TimeLabel : public ClickableQLabel
{
Q_OBJECT
public:
......@@ -142,7 +155,7 @@ protected:
if( displayType != TimeLabel::Both ) return;
event->accept();
toggleTimeDisplay();
emit timeLabelDoubleClicked();
ClickableQLabel::mouseDoubleClickEvent( event );
}
private:
intf_thread_t *p_intf;
......@@ -159,8 +172,6 @@ private:
char psz_time[MSTRTIME_MAX_SIZE];
void toggleTimeDisplay();
void paintEvent( QPaintEvent* );
signals:
void timeLabelDoubleClicked();
private slots:
void setDisplayPosition( float pos, int64_t time, int length );
void setDisplayPosition( float pos );
......
......@@ -459,7 +459,7 @@ inline void MainInterface::createStatusBar()
QStatusBar *statusBarr = statusBar();
TimeLabel *timeLabel = new TimeLabel( p_intf );
nameLabel = new QLabel( this );
nameLabel = new ClickableQLabel();
nameLabel->setTextInteractionFlags( Qt::TextSelectableByMouse
| Qt::TextSelectableByKeyboard );
SpeedLabel *speedLabel = new SpeedLabel( p_intf, this );
......@@ -480,11 +480,12 @@ inline void MainInterface::createStatusBar()
statusBarr->addPermanentWidget( speedLabel, 0 );
statusBarr->addPermanentWidget( timeLabel, 0 );
CONNECT( nameLabel, doubleClicked(), THEDP, epgDialog() );
/* timeLabel behaviour:
- double clicking opens the goto time dialog
- right-clicking and clicking just toggle between remaining and
elapsed time.*/
CONNECT( timeLabel, timeLabelDoubleClicked(), THEDP, gotoTimeDialog() );
CONNECT( timeLabel, doubleClicked(), THEDP, gotoTimeDialog() );
CONNECT( THEMIM->getIM(), encryptionChanged( bool ),
this, showCryptedLabel( bool ) );
......
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