mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 13:07:46 +00:00
PixelPaint: Make the main UI tabbed and allow multiple open images :^)
This patch adds a GUI::TabWidget to the main UI and allows having multiple images open at the same time. Some of the changes here are a bit hackish and mechanical and there's still code around that needs more work to fit better in the new world. One nice side-effect of this change is that ImageEditor now always has one Image associated with it, and it never changes.
This commit is contained in:
parent
8763492e34
commit
c6dd3377ee
14 changed files with 194 additions and 122 deletions
|
@ -28,8 +28,6 @@ public:
|
|||
Image const* image() const { return m_image; }
|
||||
Image* image() { return m_image; }
|
||||
|
||||
void set_image(RefPtr<Image>);
|
||||
|
||||
Layer* active_layer() { return m_active_layer; }
|
||||
void set_active_layer(Layer*);
|
||||
|
||||
|
@ -73,7 +71,7 @@ public:
|
|||
Gfx::FloatPoint editor_position_to_image_position(Gfx::IntPoint const&) const;
|
||||
|
||||
private:
|
||||
ImageEditor();
|
||||
explicit ImageEditor(NonnullRefPtr<Image>);
|
||||
|
||||
virtual void paint_event(GUI::PaintEvent&) override;
|
||||
virtual void second_paint_event(GUI::PaintEvent&) override;
|
||||
|
@ -95,7 +93,7 @@ private:
|
|||
void clamped_scale(float);
|
||||
void relayout();
|
||||
|
||||
RefPtr<Image> m_image;
|
||||
NonnullRefPtr<Image> m_image;
|
||||
RefPtr<Layer> m_active_layer;
|
||||
OwnPtr<GUI::UndoStack> m_undo_stack;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue