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

LibGUI: Remove Button& parameter from Button::on_click hook

There was but a single user of this parameter and it's a bit tedious
to write it out every time, so let's get rid of it.
This commit is contained in:
Andreas Kling 2020-03-03 17:02:38 +01:00
parent b1d35248e4
commit a26b63a958
26 changed files with 60 additions and 55 deletions

View file

@ -139,11 +139,16 @@ PropertiesDialog::PropertiesDialog(GUI::FileSystemModel& model, String path, boo
button_widget->layout()->add_spacer();
make_button("OK", button_widget)->on_click = [&](auto&) {if(apply_changes()) close(); };
make_button("Cancel", button_widget)->on_click = [&](auto&) { close(); };
make_button("OK", button_widget)->on_click = [this] {
if (apply_changes())
close();
};
make_button("Cancel", button_widget)->on_click = [this] {
close();
};
m_apply_button = make_button("Apply", button_widget);
m_apply_button->on_click = [&](auto&) { apply_changes(); };
m_apply_button->on_click = [this] { apply_changes(); };
m_apply_button->set_enabled(false);
update();