1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:17:34 +00:00

PixelPaint: Call set_modified on window

Call set_modified on window in order to reflect unsaved
changed in the titlebar's close button
This commit is contained in:
GeekFiftyFive 2022-03-23 19:25:54 +00:00 committed by Andreas Kling
parent 7eb672c457
commit ff8a6d8e59
3 changed files with 18 additions and 0 deletions

View file

@ -50,9 +50,16 @@ ImageEditor::~ImageEditor()
void ImageEditor::did_complete_action()
{
if (on_modified_change)
on_modified_change(true);
m_undo_stack.push(make<ImageUndoCommand>(*m_image));
}
bool ImageEditor::is_modified()
{
return undo_stack().is_current_modified();
}
bool ImageEditor::undo()
{
if (!m_undo_stack.can_undo())
@ -580,6 +587,8 @@ void ImageEditor::save_project()
return;
}
undo_stack().set_current_unmodified();
if (on_modified_change)
on_modified_change(false);
}
void ImageEditor::save_project_as()
@ -596,6 +605,8 @@ void ImageEditor::save_project_as()
set_path(file->filename());
set_loaded_from_image(false);
undo_stack().set_current_unmodified();
if (on_modified_change)
on_modified_change(false);
}
Result<void, String> ImageEditor::save_project_to_file(Core::File& file) const