From 0c4e2ce1149587e47ec998f3d90579fadfdf43e8 Mon Sep 17 00:00:00 2001 From: Peter Nelson Date: Tue, 7 Mar 2023 22:43:22 +0000 Subject: [PATCH] Change: Resize jukebox when changing music set. --- src/music_gui.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/music_gui.cpp b/src/music_gui.cpp index 4b17b83371..85d33e3f0f 100644 --- a/src/music_gui.cpp +++ b/src/music_gui.cpp @@ -178,6 +178,8 @@ void MusicSystem::ChangeMusicSet(const std::string &set_name) this->ChangePlaylist(this->selected_playlist); InvalidateWindowData(WC_GAME_OPTIONS, WN_GAME_OPTIONS_GAME_OPTIONS, 0, true); + InvalidateWindowData(WC_MUSIC_TRACK_SELECTION, 0, 1, true); + InvalidateWindowData(WC_MUSIC_WINDOW, 0, 1, true); } /** Enable shuffle mode and restart playback */ @@ -480,7 +482,12 @@ struct MusicTrackSelectionWindow : public Window { this->SetWidgetLoweredState(WID_MTS_ALL + i, i == _settings_client.music.playlist); } this->SetWidgetDisabledState(WID_MTS_CLEAR, _settings_client.music.playlist <= 3); - this->SetDirty(); + + if (data == 1) { + this->ReInit(); + } else { + this->SetDirty(); + } } void UpdateWidgetSize(int widget, Dimension *size, const Dimension &padding, Dimension *fill, Dimension *resize) override @@ -764,7 +771,11 @@ struct MusicWindow : public Window { UpdateDisabledButtons(); - this->SetDirty(); + if (data == 1) { + this->ReInit(); + } else { + this->SetDirty(); + } } void OnClick(Point pt, int widget, int click_count) override