diff options
author | Andreas Kling <kling@serenityos.org> | 2021-05-15 23:08:17 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-16 01:11:56 +0200 |
commit | ad2752276a3aaaec5292ce38fe03ae23136c26bb (patch) | |
tree | 229806bbb1d5e109f6e66dd3969b95da29b8673b /Userland/Applications/PixelPaint/ToolboxWidget.h | |
parent | 0ee7991dcab29ec84c19a4ce2228798a7a35f2c7 (diff) | |
download | serenity-ad2752276a3aaaec5292ce38fe03ae23136c26bb.zip |
PixelPaint: Use GUI::Toolbar inside the toolbox widget
We don't need to implement our own toolbar and tool button classes
when the ones from LibGUI work just fine. :^)
Diffstat (limited to 'Userland/Applications/PixelPaint/ToolboxWidget.h')
-rw-r--r-- | Userland/Applications/PixelPaint/ToolboxWidget.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Userland/Applications/PixelPaint/ToolboxWidget.h b/Userland/Applications/PixelPaint/ToolboxWidget.h index 5e9f8faeaf..c4de0ffa77 100644 --- a/Userland/Applications/PixelPaint/ToolboxWidget.h +++ b/Userland/Applications/PixelPaint/ToolboxWidget.h @@ -1,20 +1,22 @@ /* - * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2018-2021, Andreas Kling <kling@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once +#include <AK/NonnullOwnPtrVector.h> #include <LibGUI/ActionGroup.h> -#include <LibGUI/Frame.h> +#include <LibGUI/Widget.h> namespace PixelPaint { class Tool; -class ToolboxWidget final : public GUI::Frame { - C_OBJECT(ToolboxWidget) +class ToolboxWidget final : public GUI::Widget { + C_OBJECT(ToolboxWidget); + public: virtual ~ToolboxWidget() override; @@ -24,7 +26,7 @@ public: void for_each_tool(Callback callback) { for (auto& tool : m_tools) - callback(*tool); + callback(tool); } private: @@ -33,8 +35,9 @@ private: void setup_tools(); explicit ToolboxWidget(); + RefPtr<GUI::Toolbar> m_toolbar; GUI::ActionGroup m_action_group; - Vector<Tool*> m_tools; + NonnullOwnPtrVector<Tool> m_tools; }; } |