PixelPaint: Mark editor as unmodified when creating a default image

This is similar to opening an empty text file in TextEditor, the user
is only asked to saved changes if they have made any changes to it.
This commit is contained in:
Mustafa Quraish 2022-01-04 21:49:52 -05:00 committed by Andreas Kling
parent fc5c327751
commit 915211252d
Notes: sideshowbarker 2024-07-17 21:37:29 +09:00

View File

@ -112,6 +112,7 @@ void MainWidget::initialize_menubar(GUI::Window& window)
auto& editor = create_new_editor(*image);
auto image_title = dialog->image_name().trim_whitespace();
editor.set_title(image_title.is_empty() ? "Untitled" : image_title);
editor.undo_stack().set_current_unmodified();
m_layer_list_widget->set_image(image);
m_layer_list_widget->set_selected_layer(bg_layer);
@ -728,6 +729,7 @@ void MainWidget::create_default_image()
auto& editor = create_new_editor(*image);
editor.set_active_layer(bg_layer);
editor.undo_stack().set_current_unmodified();
}
void MainWidget::create_image_from_clipboard()