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.
This commit is contained in:
Karol Kosek 2022-05-21 00:23:08 +02:00 committed by Andreas Kling
parent 4656198127
commit 2d6edd5898
Notes: sideshowbarker 2024-07-17 10:41:24 +09:00

View File

@ -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"));