mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 11:38:11 +00:00
LibGUI: Add a cancel button callback to settings window tabs
Some settings tabs, like the ones on the upcoming terminal settings, need to know when the cancel button is pressed to clean up things like temporary live updates. Therefore, the SettingsWindow::Tab now features a cancel_settings callback which does not need to be implemented.
This commit is contained in:
parent
72e9d024b9
commit
1e9554145e
2 changed files with 4 additions and 1 deletions
|
@ -58,6 +58,8 @@ SettingsWindow::SettingsWindow(StringView title, ShowDefaultsButton show_default
|
|||
m_cancel_button = button_container.add<GUI::Button>("Cancel");
|
||||
m_cancel_button->set_fixed_width(75);
|
||||
m_cancel_button->on_click = [&](auto) {
|
||||
for (auto& tab : m_tabs)
|
||||
tab.cancel_settings();
|
||||
GUI::Application::the()->quit();
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue