mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 10:24:59 +00:00
HackStudio: Show the edited form widget's widget tree in the tree view
This patch introduces a simple WidgetTreeModel that models the widget tree inside of a given root GWidget.
This commit is contained in:
parent
524da0ad01
commit
d5f735ecec
7 changed files with 121 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
#include "FormEditorWidget.h"
|
||||
#include "CursorTool.h"
|
||||
#include "FormWidget.h"
|
||||
#include "WidgetTreeModel.h"
|
||||
#include <LibGUI/GPainter.h>
|
||||
|
||||
FormEditorWidget::FormEditorWidget(GWidget* parent)
|
||||
|
@ -15,6 +16,7 @@ FormEditorWidget::FormEditorWidget(GWidget* parent)
|
|||
set_frame_thickness(2);
|
||||
|
||||
m_form_widget = FormWidget::construct(*this);
|
||||
m_widget_tree_model = WidgetTreeModel::create(*m_form_widget);
|
||||
}
|
||||
|
||||
FormEditorWidget::~FormEditorWidget()
|
||||
|
@ -35,3 +37,8 @@ void FormEditorWidget::set_tool(NonnullOwnPtr<Tool> tool)
|
|||
m_tool = move(tool);
|
||||
m_tool->attach();
|
||||
}
|
||||
|
||||
WidgetTreeModel& FormEditorWidget::model()
|
||||
{
|
||||
return *m_widget_tree_model;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue