mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
compiler: Add layout information the the Element
This commit is contained in:
parent
3a8c64c946
commit
3b7c2d0c5e
5 changed files with 15 additions and 3 deletions
|
@ -649,6 +649,9 @@ pub struct Element {
|
|||
|
||||
/// The AST node, if available
|
||||
pub node: Option<syntax_nodes::Element>,
|
||||
|
||||
/// This element was a layout that has been lowered to a Rectangle
|
||||
pub layout: Option<crate::layout::Layout>,
|
||||
}
|
||||
|
||||
impl Spanned for Element {
|
||||
|
@ -2127,6 +2130,9 @@ pub fn visit_all_named_references_in_element(
|
|||
let mut layout_info_prop = std::mem::take(&mut elem.borrow_mut().layout_info_prop);
|
||||
layout_info_prop.as_mut().map(|(h, b)| (vis(h), vis(b)));
|
||||
elem.borrow_mut().layout_info_prop = layout_info_prop;
|
||||
let mut layout = std::mem::take(&mut elem.borrow_mut().layout);
|
||||
layout.as_mut().map(|l| l.visit_named_references(&mut vis));
|
||||
elem.borrow_mut().layout = layout;
|
||||
|
||||
let mut accessibility_props = std::mem::take(&mut elem.borrow_mut().accessibility_props);
|
||||
accessibility_props.0.iter_mut().for_each(|(_, x)| vis(x));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue