mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 19:29:16 +00:00
HackStudio: Reflect widget selections in the form widget tree view
You can now manipulate the widget selection either by clicking and dragging the widgets using the cursor tool, or by interacting with the form widget tree view. :^)
This commit is contained in:
@@ -75,3 +75,14 @@ void WidgetTreeModel::update()
|
||||
{
|
||||
did_update();
|
||||
}
|
||||
|
||||
GModelIndex WidgetTreeModel::index_for_widget(GWidget& widget) const
|
||||
{
|
||||
int parent_child_index = 0;
|
||||
for (auto& parent_child : widget.parent_widget()->child_widgets()) {
|
||||
if (parent_child == &widget)
|
||||
return create_index(parent_child_index, 0, &widget);
|
||||
++parent_child_index;
|
||||
}
|
||||
return {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user