diff options
author | Karol Kosek <krkk@serenityos.org> | 2022-05-21 00:23:08 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-05-25 13:42:53 +0200 |
commit | 2d6edd5898bae2e28d7d6f03e9efa33150c5d4e8 (patch) | |
tree | ad9d678939dd90b5c06715fcbb63387b3e04ec85 /Userland/Applications | |
parent | 465619812740617fcc3b2180a4d7e246adea1c51 (diff) | |
download | serenity-2d6edd5898bae2e28d7d6f03e9efa33150c5d4e8.zip |
ThemeEditor: Show unsaved changes prompt also in the quit action
While the app displayed the prompt on the close button press, the quit
action from the menu didn't do so.
Diffstat (limited to 'Userland/Applications')
-rw-r--r-- | Userland/Applications/ThemeEditor/MainWidget.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Userland/Applications/ThemeEditor/MainWidget.cpp b/Userland/Applications/ThemeEditor/MainWidget.cpp index 4c3c80c55a..f62618010e 100644 --- a/Userland/Applications/ThemeEditor/MainWidget.cpp +++ b/Userland/Applications/ThemeEditor/MainWidget.cpp @@ -231,7 +231,10 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window) }))); TRY(file_menu->try_add_separator()); - TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { GUI::Application::the()->quit(); }))); + TRY(file_menu->try_add_action(GUI::CommonActions::make_quit_action([&](auto&) { + if (request_close() == GUI::Window::CloseRequestDecision::Close) + GUI::Application::the()->quit(); + }))); auto accessibility_menu = TRY(window.try_add_menu("&Accessibility")); |