1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 23:35:08 +00:00

SoundPlayer: Enable stop button when play button clicked

Previously, if you play a file, then stop, then play again, the stop
button will be permanently disabled until you open a file again.

The stop button should be enabled whenever a file is loaded.

This commit fixes the GUI bug by enabling the stop button whenever the
play button is clicked (if a file is currently loaded).
This commit is contained in:
Nick Miller 2021-06-03 15:18:54 -07:00 committed by Ali Mohammad Pur
parent e0a2c1544f
commit 17c78be334

View file

@ -72,6 +72,7 @@ SoundPlayerWidgetAdvancedView::SoundPlayerWidgetAdvancedView(GUI::Window& window
bool paused = this->manager().toggle_pause();
set_paused(paused);
m_play_button->set_icon(paused ? *m_play_icon : *m_pause_icon);
m_stop_button->set_enabled(has_loaded_file());
};
m_stop_button = menubar.add<GUI::Button>();