From fff37d7345f4900bfc7caf7db013e0f2426b7756 Mon Sep 17 00:00:00 2001 From: griffi-gh Date: Wed, 6 Mar 2024 15:44:02 +0100 Subject: [PATCH] wrap test --- hui-examples/examples/ui_test_wrapping.rs | 36 +++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 hui-examples/examples/ui_test_wrapping.rs diff --git a/hui-examples/examples/ui_test_wrapping.rs b/hui-examples/examples/ui_test_wrapping.rs new file mode 100644 index 0000000..b679590 --- /dev/null +++ b/hui-examples/examples/ui_test_wrapping.rs @@ -0,0 +1,36 @@ +use hui::{ + color, element::{ + container::Container, + fill_rect::FillRect, + text::Text, + UiElementExt + }, layout::{Alignment, UiDirection}, size +}; + +#[path = "../boilerplate.rs"] +#[macro_use] +mod boilerplate; + +ui_main!(|ui, size, _| { + Container::default() + .with_size(size!(100%)) + .with_direction(UiDirection::Horizontal) + .with_padding(5.) + .with_gap(10.) + .with_background(color::WHITE) + //.with_wrap(true) + .with_children(|ui| { + Text::default() + .with_color(color::BLACK) + .with_text("wrapping is not actually implemented yet") + .add_child(ui); + for _ in 0..10 { + FillRect::default() + .with_size(size!(100)) + .with_corner_radius(8.) + .with_background(color::DARK_RED) + .add_child(ui); + } + }) + .add_root(ui, size); +});