From aac91d9488115ad8a15bbc7ba273e6f4f5d8a200 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Wed, 8 Aug 2012 17:29:16 +0200 Subject: [PATCH] Do not show tooltips when the relevant widgets are invisible. --- src/AudioControls.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/AudioControls.cpp b/src/AudioControls.cpp index f75a76a84..82e51d57c 100644 --- a/src/AudioControls.cpp +++ b/src/AudioControls.cpp @@ -65,13 +65,10 @@ AudioControls::AudioControls( QWidget* parent ) ui->albumLabel->setType( QueryLabel::Album ); ui->timeLabel->setFont( font ); - ui->timeLabel->setToolTip( tr( "Time Elapsed" ) ); ui->timeLeftLabel->setFont( font ); - ui->timeLeftLabel->setToolTip( tr( "Time Remaining" ) ); font.setPixelSize( 9 ); ui->ownerLabel->setFont( font ); - ui->ownerLabel->setToolTip( tr( "Music Source" ) ); ui->prevButton->setPixmap( RESPATH "images/back-rest.png" ); ui->prevButton->setPixmap( RESPATH "images/back-pressed.png", QIcon::Off, QIcon::Active ); @@ -83,17 +80,13 @@ AudioControls::AudioControls( QWidget* parent ) ui->nextButton->setPixmap( RESPATH "images/skip-pressed.png", QIcon::Off, QIcon::Active ); ui->shuffleButton->setPixmap( RESPATH "images/shuffle-off-rest.png" ); ui->shuffleButton->setPixmap( RESPATH "images/shuffle-off-pressed.png", QIcon::Off, QIcon::Active ); - ui->shuffleButton->setToolTip( tr( "Shuffle" ) ); ui->repeatButton->setPixmap( RESPATH "images/repeat-off-rest.png" ); ui->repeatButton->setPixmap( RESPATH "images/repeat-off-pressed.png", QIcon::Off, QIcon::Active ); - ui->repeatButton->setToolTip( tr( "Repeat" ) ); ui->volumeLowButton->setPixmap( RESPATH "images/volume-icon-muted.png" ); ui->volumeHighButton->setPixmap( RESPATH "images/volume-icon-full.png" ); ui->socialButton->setPixmap( RESPATH "images/share.png" ); - ui->socialButton->setToolTip( tr( "Share" ) ); ui->loveButton->setPixmap( RESPATH "images/not-loved.png" ); ui->loveButton->setCheckable( true ); - ui->loveButton->setToolTip( tr( "Love" ) ); ui->socialButton->setFixedSize( QSize( 20, 20 ) ); ui->loveButton->setFixedSize( QSize( 20, 20 ) ); @@ -262,6 +255,14 @@ AudioControls::onPlaybackLoading( const Tomahawk::result_ptr& result ) ui->socialButton->setEnabled( true ); ui->socialButton->setVisible( true ); + ui->timeLabel->setToolTip( tr( "Time Elapsed" ) ); + ui->timeLeftLabel->setToolTip( tr( "Time Remaining" ) ); + ui->ownerLabel->setToolTip( tr( "Music Source" ) ); + ui->shuffleButton->setToolTip( tr( "Shuffle" ) ); + ui->repeatButton->setToolTip( tr( "Repeat" ) ); + ui->socialButton->setToolTip( tr( "Share" ) ); + ui->loveButton->setToolTip( tr( "Love" ) ); + setCover(); setSocialActions(); } @@ -367,6 +368,14 @@ AudioControls::onPlaybackStopped() ui->loveButton->setVisible( false ); ui->socialButton->setEnabled( false ); ui->socialButton->setVisible( false ); + + ui->timeLabel->setToolTip( "" ); + ui->timeLeftLabel->setToolTip( "" ); + ui->ownerLabel->setToolTip( "" ); + ui->shuffleButton->setToolTip( "" ); + ui->repeatButton->setToolTip( "" ); + ui->socialButton->setToolTip( "" ); + ui->loveButton->setToolTip( "" ); }