From 4b886a16574ed723316f6df95bc3ca991bfdd6b0 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Fri, 4 Jan 2013 14:43:04 +0100 Subject: [PATCH] * Reset seekbar during loading so items don't move around. --- src/AudioControls.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/AudioControls.cpp b/src/AudioControls.cpp index c92219994..52752d87f 100644 --- a/src/AudioControls.cpp +++ b/src/AudioControls.cpp @@ -227,15 +227,12 @@ AudioControls::onPlaybackStarted( const Tomahawk::result_ptr& result ) ui->seekSlider->setValue( 0 ); ui->seekSlider->setEnabled( AudioEngine::instance()->canSeek() ); - m_sliderTimeLine.stop(); m_sliderTimeLine.setDuration( duration ); m_sliderTimeLine.setFrameRange( 0, duration ); m_sliderTimeLine.setCurveShape( QTimeLine::LinearCurve ); m_sliderTimeLine.setCurrentTime( 0 ); m_seeked = false; - ui->seekSlider->setVisible( true ); - int updateRate = (double)1000 / ( (double)ui->seekSlider->contentsRect().width() / (double)( duration / 1000 ) ); m_sliderTimeLine.setUpdateInterval( qBound( 40, updateRate, 500 ) ); @@ -284,6 +281,11 @@ AudioControls::onPlaybackLoading( const Tomahawk::result_ptr& result ) ui->loveButton->setToolTip( tr( "Love" ) ); ui->ownerButton->setToolTip( QString( tr( "Playing from %1" ) ).arg( result->friendlySource() ) ); + ui->seekSlider->setRange( 0, 0 ); + ui->seekSlider->setValue( 0 ); + ui->seekSlider->setVisible( true ); + m_sliderTimeLine.stop(); + // If the ViewManager doesn't know a page for the current interface, we can't offer the jump link ui->artistTrackLabel->setJumpLinkVisible( ( ViewManager::instance()->pageForInterface( AudioEngine::instance()->currentTrackPlaylist() ) ) );