learn how workspaces + proc macros work & restructure everything

This commit is contained in:
2025-12-09 01:52:45 -05:00
parent 434e3c3af7
commit e44bb8eca4
76 changed files with 610 additions and 576 deletions

View File

@@ -56,10 +56,9 @@ impl DefaultAppState for Client {
let add_button = rect(Color::LIME)
.radius(30)
.on(CursorSense::click(), move |ctx| {
let child = ctx
.ui
.add(image(include_bytes!("assets/sungals.png")).center())
.any();
let child = image(include_bytes!("assets/sungals.png"))
.center()
.add(ctx.ui);
span_add_.get_mut().children.push(child);
})
.sized((150, 150))
@@ -106,7 +105,7 @@ impl DefaultAppState for Client {
.text_align(Align::LEFT)
.size(30)
.attr::<Selectable>(())
.on(iris::winit::Submit, move |ctx| {
.on(Submit, move |ctx| {
let content = ctx.widget.get_mut().take();
let text = wtext(content)
.editable(false)
@@ -115,7 +114,7 @@ impl DefaultAppState for Client {
.wrap(true)
.attr::<Selectable>(());
let msg_box = text.background(rect(Color::WHITE.darker(0.5))).add(ctx.ui);
texts.get_mut().children.push(msg_box.any());
texts.get_mut().children.push(msg_box);
})
.add(ui);
let text_edit_scroll = (
@@ -163,13 +162,13 @@ impl DefaultAppState for Client {
};
let tabs = (
switch_button(Color::RED, pad_test.any(), "pad"),
switch_button(Color::GREEN, span_test.any(), "span"),
switch_button(Color::BLUE, span_add_test.any(), "image span"),
switch_button(Color::MAGENTA, text_test.any(), "text layout"),
switch_button(Color::RED, pad_test, "pad"),
switch_button(Color::GREEN, span_test, "span"),
switch_button(Color::BLUE, span_add_test, "image span"),
switch_button(Color::MAGENTA, text_test, "text layout"),
switch_button(
Color::YELLOW.mul_rgb(0.5),
text_edit_scroll.any(),
text_edit_scroll,
"text edit scroll",
),
)