summaryrefslogtreecommitdiff
path: root/Userland/Applications/PixelPaint/ToolboxWidget.h
diff options
context:
space:
mode:
authorMustafa Quraish <mustafaq9@gmail.com>2021-09-12 21:36:01 -0400
committerAndreas Kling <kling@serenityos.org>2021-09-13 13:43:53 +0200
commitecf8f243a6d09cd827dca6a31b6846977cf1699a (patch)
tree718a3dacbe20d4a93b5b2b1dc82fb85b91f591be /Userland/Applications/PixelPaint/ToolboxWidget.h
parentee25e2adc22d96bb2dc7113cc5e87c3197defb90 (diff)
downloadserenity-ecf8f243a6d09cd827dca6a31b6846977cf1699a.zip
PixelPaint: Have `ToolboxWidget` keep track of active tool
Since there's only one global toolbox, it makes sense to store the active tool in here, since we don't really have control over the deletion of an editor.
Diffstat (limited to 'Userland/Applications/PixelPaint/ToolboxWidget.h')
-rw-r--r--Userland/Applications/PixelPaint/ToolboxWidget.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Applications/PixelPaint/ToolboxWidget.h b/Userland/Applications/PixelPaint/ToolboxWidget.h
index c4de0ffa77..6de446ce56 100644
--- a/Userland/Applications/PixelPaint/ToolboxWidget.h
+++ b/Userland/Applications/PixelPaint/ToolboxWidget.h
@@ -29,6 +29,8 @@ public:
callback(tool);
}
+ Tool* active_tool() const { return m_active_tool; }
+
private:
friend class ToolButton;
@@ -38,6 +40,7 @@ private:
RefPtr<GUI::Toolbar> m_toolbar;
GUI::ActionGroup m_action_group;
NonnullOwnPtrVector<Tool> m_tools;
+ Tool* m_active_tool { nullptr };
};
}