sized widgets!

This commit is contained in:
2025-08-28 01:35:43 -04:00
parent d4d0b3b580
commit 834182ffe8
14 changed files with 313 additions and 106 deletions

View File

@@ -88,11 +88,25 @@ impl Client {
(rect, text(label).size(30)).stack()
};
let text_test = ui.add_static(
(
text("this is a").size(30),
text("teeeeeeeest").size(30),
text("okkk\nokkkkkk!").size(30),
text("hmm").size(30),
text("a").size(30),
text("'").size(30),
text("pretty cool right?").size(30),
)
.span(Dir::RIGHT, [sized(); _]),
);
let tabs = ui.add(
(
switch_button(Color::RED, pad_test, "pad test"),
switch_button(Color::GREEN, span_test, "span test"),
switch_button(Color::BLUE, span_add, "span add test"),
switch_button(Color::MAGENTA, text_test, "text test"),
)
.span(Dir::RIGHT, [1; _]),
);
@@ -102,7 +116,7 @@ impl Client {
let child = ui
.add(image(include_bytes!("assets/sungals.png")))
.erase_type();
ui[span_add].children.push((child, ratio(1)));
ui[span_add].children.push((child, sized()));
})
.region(
UiPos::corner(Corner::BotRight)
@@ -134,7 +148,7 @@ impl Client {
main,
add_button.label("add button"),
del_button.label("del button"),
info_sect.label("info sect"),
// info_sect.label("info sect"),
)
.stack()
.label("main stack"),