summaryrefslogtreecommitdiff
path: root/Userland/Applications/PixelPaint/ImageEditor.h
diff options
context:
space:
mode:
authorMustafa Quraish <mustafaq9@gmail.com>2022-01-07 17:35:31 -0500
committerAndreas Kling <kling@serenityos.org>2022-01-09 00:19:47 +0100
commitc2b3bab984865796dee3c385b50cb601f84f7363 (patch)
tree87759e9e111678b503f8a12f369fabe3d1adfe92 /Userland/Applications/PixelPaint/ImageEditor.h
parentb3e47f0bd501e5cef590fdde8e3e7b3502aa0a95 (diff)
downloadserenity-c2b3bab984865796dee3c385b50cb601f84f7363.zip
PixelPaint: Move `save` and `save_as` logic inside `ImageEditor`
Previously the save logic was hardcoded to only work for the active editor, so closing editors in the background would not properly handle the unsaved changes. This patch brings us closer to be able to fix that problem.
Diffstat (limited to 'Userland/Applications/PixelPaint/ImageEditor.h')
-rw-r--r--Userland/Applications/PixelPaint/ImageEditor.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/Userland/Applications/PixelPaint/ImageEditor.h b/Userland/Applications/PixelPaint/ImageEditor.h
index a660ac1202..fd8cf7ca47 100644
--- a/Userland/Applications/PixelPaint/ImageEditor.h
+++ b/Userland/Applications/PixelPaint/ImageEditor.h
@@ -109,7 +109,8 @@ public:
Gfx::FloatPoint image_position_to_editor_position(Gfx::IntPoint const&) const;
Gfx::FloatPoint editor_position_to_image_position(Gfx::IntPoint const&) const;
- Result<void, String> save_project_to_fd_and_close(int fd) const;
+ void save_project_as();
+ void save_project();
NonnullRefPtrVector<Guide> const& guides() const { return m_guides; }
bool guide_visibility() { return m_show_guides; }
@@ -149,6 +150,8 @@ private:
GUI::MouseEvent event_adjusted_for_layer(GUI::MouseEvent const&, Layer const&) const;
GUI::MouseEvent event_with_pan_and_scale_applied(GUI::MouseEvent const&) const;
+ Result<void, String> save_project_to_fd_and_close(int fd) const;
+
void clamped_scale_by(float, bool do_relayout);
void relayout();