1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-25 22:35:07 +00:00
serenity/DevTools/HackStudio/FormWidget.h
Andreas Kling 567769eb2f HackStudio: Allow moving widgets around using the CursorTool
You can now move the widgets around, either by themselves or in group
selections, by dragging them with the cursor tool. :^)
2019-11-10 22:31:10 +01:00

28 lines
743 B
C++

#pragma once
#include <LibGUI/GWidget.h>
class FormEditorWidget;
class FormWidget final : public GWidget {
C_OBJECT(FormWidget)
public:
virtual ~FormWidget() override;
FormEditorWidget& editor();
const FormEditorWidget& editor() const;
// FIXME: This should be an app-wide preference instead.
int grid_size() const { return m_grid_size; }
private:
virtual void paint_event(GPaintEvent&) override;
virtual void second_paint_event(GPaintEvent&) override;
virtual void mousedown_event(GMouseEvent&) override;
virtual void mouseup_event(GMouseEvent&) override;
virtual void mousemove_event(GMouseEvent&) override;
explicit FormWidget(FormEditorWidget& parent);
int m_grid_size { 5 };
};