Skip to content

Commit

Permalink
compiler: Add layout debug info to all nodes when lowering layouts
Browse files Browse the repository at this point in the history
This enables us to find all layouts e.g. in

```slint
component MyLayout inherits GridLayout { @children }

component FooBar {
   my-layout := MyLayout {
      Rectangle {
      }
   }
}
```
  • Loading branch information
hunger committed Feb 26, 2024
1 parent 171c9e2 commit 48de2f8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions internal/compiler/passes/lower_layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ fn lower_grid_layout(
);
grid_layout_element.borrow_mut().layout_info_prop =
Some((layout_info_prop_h, layout_info_prop_v));
if let Some(d) = grid_layout_element.borrow_mut().debug.last_mut() {
d.1 = Some(Layout::GridLayout(grid));
for d in grid_layout_element.borrow_mut().debug.iter_mut() {
d.1 = Some(Layout::GridLayout(grid.clone()));
}
}

Expand Down Expand Up @@ -436,8 +436,8 @@ fn lower_box_layout(
.into(),
);
layout_element.borrow_mut().layout_info_prop = Some((layout_info_prop_h, layout_info_prop_v));
if let Some(d) = layout_element.borrow_mut().debug.last_mut() {
d.1 = Some(Layout::BoxLayout(layout));
for d in layout_element.borrow_mut().debug.iter_mut() {
d.1 = Some(Layout::BoxLayout(layout.clone()));
}
}

Expand Down Expand Up @@ -649,8 +649,8 @@ fn lower_dialog_layout(
.into(),
);
dialog_element.borrow_mut().layout_info_prop = Some((layout_info_prop_h, layout_info_prop_v));
if let Some(d) = dialog_element.borrow_mut().debug.last_mut() {
d.1 = Some(Layout::GridLayout(grid));
for d in dialog_element.borrow_mut().debug.iter_mut() {
d.1 = Some(Layout::GridLayout(grid.clone()));
}
}

Expand Down

0 comments on commit 48de2f8

Please sign in to comment.