Testing layout

This commit is contained in:
2026-07-14 10:55:57 -04:00
parent 3987c81b4f
commit 926fec243e
4 changed files with 168 additions and 4 deletions
+29 -1
View File
@@ -1,3 +1,31 @@
use pulse_ui::layout::{LayoutItem, Rect, Size};
fn main() {
println!("Hello, world!");
let layout = LayoutItem::Row {
width: Size::Percent(100),
height: Size::Percent(100),
items: vec![
LayoutItem::Widget {
width: Size::Percent(100),
height: Size::Flex(1),
},
LayoutItem::Widget {
width: Size::Percent(100),
height: Size::Flex(1),
},
],
};
let screen = Rect {
x: 0,
y: 0,
width: 60,
height: 12,
};
let mut alloc = Vec::new();
layout.allocate(&screen, &mut alloc);
println!("{:?}", alloc);
}