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

LibGUI: Include keyboard modifier state with button on_click calls

This will allow you us to implement special behavior when Ctrl+clicking
a button.
This commit is contained in:
Andreas Kling 2020-05-12 20:30:33 +02:00
parent 3a905aed06
commit 977863ea07
37 changed files with 76 additions and 76 deletions

View file

@ -81,14 +81,14 @@ SoundPlayerWidget::SoundPlayerWidget(GUI::Window& window, NonnullRefPtr<Audio::C
m_play = control_widget.add<GUI::Button>();
m_play->set_icon(*m_pause_icon);
m_play->set_enabled(false);
m_play->on_click = [this] {
m_play->on_click = [this](auto) {
m_play->set_icon(m_manager.toggle_pause() ? *m_play_icon : *m_pause_icon);
};
m_stop = control_widget.add<GUI::Button>();
m_stop->set_enabled(false);
m_stop->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/stop.png"));
m_stop->on_click = [this] { m_manager.stop(); };
m_stop->on_click = [this](auto) { m_manager.stop(); };
m_status = add<GUI::Label>();
m_status->set_frame_shape(Gfx::FrameShape::Box);