mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-02-21 15:14:13 +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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user