mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-03 16:16:43 +00:00
PixelPaint: Only prompt for unsaved changes if there any
Previously MainWidget::request_close() would always put up the message box asking to save unsaved changes, even if there aren't any. This patch makes it so that the message box is only shown if the undo stack is in a modified state.
This commit is contained in:
parent
2440d2c2fe
commit
8c4579bced
Notes:
sideshowbarker
2024-07-17 21:37:37 +09:00
Author: https://github.com/mustafaquraish
Commit: 8c4579bced
Pull-request: https://github.com/SerenityOS/serenity/pull/11632
1 changed files with 4 additions and 0 deletions
|
@ -755,6 +755,10 @@ bool MainWidget::request_close()
|
|||
|
||||
VERIFY(current_image_editor());
|
||||
|
||||
if (!current_image_editor()->undo_stack().is_current_modified()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
auto result = GUI::MessageBox::ask_about_unsaved_changes(window(), current_image_editor()->path(), current_image_editor()->undo_stack().last_unmodified_timestamp());
|
||||
|
||||
if (result == GUI::MessageBox::ExecYes) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue