1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 05:27:43 +00:00

HackStudio: Introduce a Tool class with subs CursorTool and WidgetTool

These will be used to draw out new widgets on a FormWidget, or in the
case of CursorTool, to select and manipulate existing widgets.
This commit is contained in:
Andreas Kling 2019-11-10 21:45:32 +01:00
parent a04ab219d1
commit e87756424d
12 changed files with 166 additions and 0 deletions

View file

@ -3,6 +3,7 @@
#include <LibGUI/GScrollableWidget.h>
class FormWidget;
class Tool;
class FormEditorWidget final : public GScrollableWidget {
C_OBJECT(FormEditorWidget)
@ -12,10 +13,17 @@ public:
FormWidget& form_widget() { return *m_form_widget; }
const FormWidget& form_widget() const { return *m_form_widget; }
Tool& tool() { return *m_tool; }
const Tool& tool() const { return *m_tool; }
void set_tool(NonnullOwnPtr<Tool>);
private:
virtual void paint_event(GPaintEvent&) override;
explicit FormEditorWidget(GWidget* parent);
RefPtr<FormWidget> m_form_widget;
NonnullOwnPtr<Tool> m_tool;
};