FINALLY transition events to global; slow text sending bug tho

This commit is contained in:
2025-12-11 01:21:36 -05:00
parent 2537284372
commit baaeb6b027
21 changed files with 650 additions and 557 deletions

View File

@@ -58,7 +58,7 @@ impl DefaultAppState for Client {
.on(CursorSense::click(), move |ctx| {
let child = image(include_bytes!("assets/sungals.png"))
.center()
.add(ctx.ui);
.add(ctx.data.ui);
span_add_.get_mut().children.push(child);
})
.sized((150, 150))
@@ -113,7 +113,9 @@ impl DefaultAppState for Client {
.text_align(Align::LEFT)
.wrap(true)
.attr::<Selectable>(());
let msg_box = text.background(rect(Color::WHITE.darker(0.5))).add(ctx.ui);
let msg_box = text
.background(rect(Color::WHITE.darker(0.5)))
.add(&mut Ui::new());
texts_.get_mut().children.push(msg_box);
})
.add(ui);
@@ -126,7 +128,7 @@ impl DefaultAppState for Client {
add_text.width(rest(1)),
Rect::new(Color::GREEN)
.on(CursorSense::click(), move |ctx| {
ctx.ui.run_event(ctx.state, add_text_, Submit, ());
Events::<Submit, _>::run(add_text_.id(), &mut (), ctx.state);
})
.sized((40, 40)),
)