From c2b3bab984865796dee3c385b50cb601f84f7363 Mon Sep 17 00:00:00 2001 From: Mustafa Quraish Date: Fri, 7 Jan 2022 17:35:31 -0500 Subject: 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. --- Userland/Applications/PixelPaint/ImageEditor.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'Userland/Applications/PixelPaint/ImageEditor.h') 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 save_project_to_fd_and_close(int fd) const; + void save_project_as(); + void save_project(); NonnullRefPtrVector 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 save_project_to_fd_and_close(int fd) const; + void clamped_scale_by(float, bool do_relayout); void relayout(); -- cgit v1.2.3