sized widgets!
This commit is contained in:
@@ -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"),
|
||||
|
||||
Reference in New Issue
Block a user