diff --git a/modules/gui/qt/maininterface/mainctx_win32.cpp b/modules/gui/qt/maininterface/mainctx_win32.cpp index 9fa9b5d9c6ce6b552e6ea5e08d4f1481ebfca9f1..8bc07d588c5fcee90a1bfef04f90b4cd3c748e6a 100644 --- a/modules/gui/qt/maininterface/mainctx_win32.cpp +++ b/modules/gui/qt/maininterface/mainctx_win32.cpp @@ -656,17 +656,17 @@ void WinTaskbarWidget::createTaskBarButtons() thbButtons[0].dwMask = dwMask; thbButtons[0].iId = 0; thbButtons[0].iBitmap = 0; - thbButtons[0].dwFlags = THEMPL->count() > 1 ? THBF_ENABLED : THBF_HIDDEN; + thbButtons[0].dwFlags = THEMPL->hasPrev() ? THBF_ENABLED : THBF_DISABLED; thbButtons[1].dwMask = dwMask; thbButtons[1].iId = 1; thbButtons[1].iBitmap = 2; - thbButtons[1].dwFlags = THEMPL->count() > 0 ? THBF_ENABLED : THBF_HIDDEN; + thbButtons[1].dwFlags = THEMPL->count() > 0 ? THBF_ENABLED : THBF_DISABLED; thbButtons[2].dwMask = dwMask; thbButtons[2].iId = 2; thbButtons[2].iBitmap = 3; - thbButtons[2].dwFlags = THEMPL->count() > 1 ? THBF_ENABLED : THBF_HIDDEN; + thbButtons[2].dwFlags = THEMPL->hasNext() ? THBF_ENABLED : THBF_DISABLED; hr = p_taskbl->ThumbBarSetImageList( winId, himl ); if( FAILED(hr) ) @@ -683,8 +683,12 @@ void WinTaskbarWidget::createTaskBarButtons() this, &WinTaskbarWidget::changeThumbbarButtons); connect( THEMPL, &vlc::playlist::PlaylistController::countChanged, this, &WinTaskbarWidget::playlistItemCountChanged ); + connect( THEMPL, &vlc::playlist::PlaylistController::hasPrevChanged, + this, &WinTaskbarWidget::changeThumbbarButtons ); + connect( THEMPL, &vlc::playlist::PlaylistController::hasNextChanged, + this, &WinTaskbarWidget::changeThumbbarButtons ); if( THEMIM->getPlayingState() == PlayerController::PLAYING_STATE_PLAYING ) - changeThumbbarButtons( THEMIM->getPlayingState() ); + changeThumbbarButtons( ); } bool WinTaskbarWidget::nativeEventFilter(const QByteArray &, void *message, qintptr* /* result */) @@ -724,16 +728,16 @@ bool WinTaskbarWidget::nativeEventFilter(const QByteArray &, void *message, qint void WinTaskbarWidget::playlistItemCountChanged( size_t ) { - changeThumbbarButtons( THEMIM->getPlayingState() ); + changeThumbbarButtons( ); } void WinTaskbarWidget::onVideoFullscreenChanged( bool fs ) { if( !fs ) - changeThumbbarButtons( THEMIM->getPlayingState() ); + changeThumbbarButtons( ); } -void WinTaskbarWidget::changeThumbbarButtons( PlayerController::PlayingState i_status ) +void WinTaskbarWidget::changeThumbbarButtons( ) { if( p_taskbl == NULL ) return; @@ -747,7 +751,7 @@ void WinTaskbarWidget::changeThumbbarButtons( PlayerController::PlayingState i_s thbButtons[0].dwMask = dwMask; thbButtons[0].iId = 0; thbButtons[0].iBitmap = 0; - thbButtons[0].dwFlags = THEMPL->count() > 1 ? THBF_ENABLED : THBF_HIDDEN; + thbButtons[0].dwFlags = THEMPL->hasPrev() ? THBF_ENABLED : THBF_DISABLED; //play/pause thbButtons[1].dwMask = dwMask; @@ -758,9 +762,9 @@ void WinTaskbarWidget::changeThumbbarButtons( PlayerController::PlayingState i_s thbButtons[2].dwMask = dwMask; thbButtons[2].iId = 2; thbButtons[2].iBitmap = 3; - thbButtons[2].dwFlags = THEMPL->count() > 1 ? THBF_ENABLED : THBF_HIDDEN; + thbButtons[2].dwFlags = THEMPL->hasNext() ? THBF_ENABLED : THBF_DISABLED; - switch( i_status ) + switch( THEMIM->getPlayingState() ) { case PlayerController::PLAYING_STATE_PLAYING: { diff --git a/modules/gui/qt/maininterface/mainctx_win32.hpp b/modules/gui/qt/maininterface/mainctx_win32.hpp index ab4cff8b35bde202dbd5a49fcdd89f86d0962458..24ca6e00c70e916e37041f98ea3ee42e5c383552 100644 --- a/modules/gui/qt/maininterface/mainctx_win32.hpp +++ b/modules/gui/qt/maininterface/mainctx_win32.hpp @@ -46,7 +46,7 @@ private: void createTaskBarButtons(); private slots: - void changeThumbbarButtons(PlayerController::PlayingState ); + void changeThumbbarButtons(); void playlistItemCountChanged( size_t itemId ); virtual void onVideoFullscreenChanged( bool fs );