From 518002dfd178213a46d5ce0752cd0aafaf4aa339 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 18 Mar 2011 06:03:29 +0100 Subject: [PATCH] * Open the SettingsDialog with the first tab. * Don't restart overlay animation if it's already in progress / finished. --- src/libtomahawk/widgets/overlaywidget.cpp | 5 ++--- src/libtomahawk/widgets/overlaywidget.h | 1 + src/settingsdialog.ui | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libtomahawk/widgets/overlaywidget.cpp b/src/libtomahawk/widgets/overlaywidget.cpp index 780d5c4ce..2abceb272 100644 --- a/src/libtomahawk/widgets/overlaywidget.cpp +++ b/src/libtomahawk/widgets/overlaywidget.cpp @@ -19,7 +19,7 @@ OverlayWidget::OverlayWidget( QWidget* parent ) setAttribute( Qt::WA_TranslucentBackground, true ); setOpacity( m_opacity ); - + m_timer.setSingleShot( true ); connect( &m_timer, SIGNAL( timeout() ), this, SLOT( hide() ) ); } @@ -63,10 +63,9 @@ OverlayWidget::show( int timeoutSecs ) QPropertyAnimation* animation = new QPropertyAnimation( this, "opacity" ); animation->setDuration( FADING_DURATION ); - animation->setStartValue( 0.00 ); animation->setEndValue( OPACITY ); animation->start(); - + if( timeoutSecs > 0 ) m_timer.start( timeoutSecs * 1000 ); } diff --git a/src/libtomahawk/widgets/overlaywidget.h b/src/libtomahawk/widgets/overlaywidget.h index 5eeecdde9..7efe77af8 100644 --- a/src/libtomahawk/widgets/overlaywidget.h +++ b/src/libtomahawk/widgets/overlaywidget.h @@ -23,6 +23,7 @@ public: void setText( const QString& text ); bool shown() const; + public slots: void show( int timeoutSecs = 0 ); void hide(); diff --git a/src/settingsdialog.ui b/src/settingsdialog.ui index 282665429..3a07d4254 100644 --- a/src/settingsdialog.ui +++ b/src/settingsdialog.ui @@ -23,7 +23,7 @@ - 1 + 0