blob: 241bfd9e6183aa5b1d31162c3499c2da7aa37d0f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
use tui::layout::Rect;
use crate::tuice::{Bounds, Element, LayoutNode, TmpComponent};
pub fn build_layout_tree<Message>(area: Rect, root: &Element<'_, Message>) -> LayoutNode {
let mut root_layout_node = LayoutNode::from_rect(area);
let bounds = Bounds {
min_width: 0,
min_height: 0,
max_width: area.width,
max_height: area.height,
};
let _ = root.layout(bounds, &mut root_layout_node);
root_layout_node
}
|