alignment!!!
This commit is contained in:
@@ -39,7 +39,7 @@ impl Client {
|
||||
(
|
||||
rect.color(Color::BLUE),
|
||||
(
|
||||
rect.color(Color::RED).center((100.0, 100.0)),
|
||||
rect.color(Color::RED).sized((100.0, 100.0)),
|
||||
(rect.color(Color::ORANGE), rect.color(Color::LIME).pad(10.0))
|
||||
.span(Dir::RIGHT, [1, 1]),
|
||||
rect.color(Color::YELLOW),
|
||||
@@ -91,62 +91,55 @@ impl Client {
|
||||
|
||||
let text_test = ui.add_static(
|
||||
(
|
||||
text("this is a").size(30),
|
||||
text("teeeeeeeest").size(30),
|
||||
text("okkk\nokkkkkk!").size(30),
|
||||
text("this is a").size(30).align(Align::Left),
|
||||
text("teeeeeeeest").size(30).align(Align::Left),
|
||||
text("okkk\nokkkkkk!").size(30).align(Align::Left),
|
||||
text("hmm").size(30),
|
||||
text("a").size(30),
|
||||
(
|
||||
text("'").size(30).family(Family::Monospace),
|
||||
text("'").size(30).family(Family::Monospace),
|
||||
text(":gamer mode").size(30).family(Family::Monospace),
|
||||
Rect::new(Color::BLUE).sized(100),
|
||||
)
|
||||
.span(Dir::RIGHT, [sized(); _]),
|
||||
.span(Dir::RIGHT, sized())
|
||||
.center(),
|
||||
text("pretty cool right?").size(30),
|
||||
)
|
||||
.span(Dir::DOWN, [sized(); _]),
|
||||
.span(Dir::DOWN, 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; _]),
|
||||
);
|
||||
let tabs = (
|
||||
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, ratio(1));
|
||||
|
||||
let add_button = Rect::new(Color::LIME)
|
||||
.radius(30)
|
||||
.on(PRESS_START, move |ui| {
|
||||
let child = ui
|
||||
.add(image(include_bytes!("assets/sungals.png")))
|
||||
.add(image(include_bytes!("assets/sungals.png")).center())
|
||||
.erase_type();
|
||||
ui[span_add].children.push((child, sized()));
|
||||
})
|
||||
.region(
|
||||
UiPos::corner(Corner::BotRight)
|
||||
.expand((150, 150))
|
||||
.shifted((-75, -75)),
|
||||
);
|
||||
.sized(150)
|
||||
.align(Align::BotRight);
|
||||
|
||||
let del_button = Rect::new(Color::RED)
|
||||
.radius(30)
|
||||
.on(PRESS_START, move |ui| {
|
||||
ui[span_add].children.pop();
|
||||
})
|
||||
.region(
|
||||
UiPos::corner(Corner::BotLeft)
|
||||
.expand((150, 150))
|
||||
.shifted((75, -75)),
|
||||
);
|
||||
.sized(150)
|
||||
.align(Align::BotLeft);
|
||||
|
||||
let info = ui.add(text(""));
|
||||
let info_sect = info.clone().region(
|
||||
UiPos::corner(Corner::TopRight)
|
||||
.expand((150, 150))
|
||||
.shifted((-75, 0)),
|
||||
);
|
||||
let info_sect = info
|
||||
.clone()
|
||||
.region(Align::TopRight.pos().expand((150, 150)).shifted((-75, 0)));
|
||||
ui.set_base(
|
||||
(
|
||||
tabs.label("tabs"),
|
||||
|
||||
Reference in New Issue
Block a user