1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:28:12 +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

@ -219,7 +219,7 @@ FontEditorWidget::FontEditorWidget(const String& path, RefPtr<Gfx::Font>&& edite
save_button.set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
save_button.set_preferred_size(80, 0);
save_button.set_text("Save");
save_button.on_click = [this] {
save_button.on_click = [this](auto) {
auto ret_val = m_edited_font->write_to_file(m_path);
if (!ret_val) {
GUI::MessageBox::show("The font file could not be saved.", "Save failed", GUI::MessageBox::Type::Error, GUI::MessageBox::InputType::OK, window());
@ -230,7 +230,7 @@ FontEditorWidget::FontEditorWidget(const String& path, RefPtr<Gfx::Font>&& edite
quit_button.set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
quit_button.set_preferred_size(80, 0);
quit_button.set_text("Quit");
quit_button.on_click = [this] {
quit_button.on_click = [](auto) {
exit(0);
};