mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:07:34 +00:00
VisualBuilder: Make it possible to insert widgets from the toolbox.
This commit is contained in:
parent
c71ece77fa
commit
75c76f6692
3 changed files with 41 additions and 6 deletions
|
@ -9,6 +9,8 @@ public:
|
|||
explicit VBForm(const String& name, GWidget* parent = nullptr);
|
||||
virtual ~VBForm() override;
|
||||
|
||||
static VBForm* current();
|
||||
|
||||
String name() const { return m_name; }
|
||||
void set_name(const String& name) { m_name = name; }
|
||||
|
||||
|
@ -18,6 +20,8 @@ public:
|
|||
void set_should_snap_to_grip(bool snap) { m_should_snap_to_grid = snap; }
|
||||
bool should_snap_to_grid() const { return m_should_snap_to_grid; }
|
||||
|
||||
void insert_widget(WidgetType);
|
||||
|
||||
protected:
|
||||
virtual void paint_event(GPaintEvent&) override;
|
||||
virtual void second_paint_event(GPaintEvent&) override;
|
||||
|
@ -35,5 +39,6 @@ private:
|
|||
WeakPtr<VBWidget> m_selected_widget;
|
||||
Point m_transform_event_origin;
|
||||
Rect m_transform_widget_origin_rect;
|
||||
Point m_next_insertion_position;
|
||||
Direction m_resize_direction { Direction::None };
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue