(widget: &Scaffold)
| 81 | |
| 82 | impl ScaffoldElement { |
| 83 | pub fn new(widget: &Scaffold) -> Self { |
| 84 | let node = LayoutSystem::new_node( |
| 85 | style::Style { |
| 86 | flex_direction: style::FlexDirection::Column, |
| 87 | align_items: style::AlignItems::Stretch, |
| 88 | // align_content: style::AlignContent::FlexStart, |
| 89 | // justify_content: style::JustifyContent::Center, |
| 90 | size: geometry::Size { |
| 91 | width: style::Dimension::Percent(1.0), |
| 92 | height: style::Dimension::Percent(1.0), |
| 93 | }, |
| 94 | ..default() |
| 95 | }, |
| 96 | vec![], |
| 97 | ) |
| 98 | .unwrap(); |
| 99 | |
| 100 | // assert!(options.rendering.is_some(), "No Rendering given to Canvas, cannot create a canvas without one."); |
| 101 | |
| 102 | let component = WidgetComponent::get(widget.key.id()); |
| 103 | |
| 104 | // canvas = self; |
| 105 | // let scale = widget.scale; |
| 106 | |
| 107 | let mut childs = Vec::new(); |
| 108 | |
| 109 | let app_bar_height = widget.app_bar.preferred_size().1; |
| 110 | let app_bar = widget.app_bar.create_element(); |
| 111 | { |
| 112 | let childs = &mut childs; |
| 113 | if let Some(child) = app_bar.node() { |
| 114 | let child_style = LayoutSystem::style(child).unwrap(); |
| 115 | LayoutSystem::set_style( |
| 116 | child, |
| 117 | style::Style { |
| 118 | align_self: style::AlignSelf::FlexStart, |
| 119 | size: geometry::Size { |
| 120 | width: style::Dimension::Percent(1.0), |
| 121 | height: style::Dimension::Points(app_bar_height), |
| 122 | }, |
| 123 | ..child_style |
| 124 | }, |
| 125 | ) |
| 126 | .unwrap(); |
| 127 | childs.push(child); |
| 128 | } |
| 129 | } |
| 130 | |
| 131 | let body = widget.body.create_element(); |
| 132 | { |
| 133 | let childs = &mut childs; |
| 134 | if let Some(child) = body.node() { |
| 135 | let child_style = LayoutSystem::style(child).unwrap(); |
| 136 | LayoutSystem::set_style( |
| 137 | child, |
| 138 | style::Style { |
| 139 | flex_grow: 1.0, |
| 140 | size: geometry::Size { |
nothing calls this directly
no test coverage detected