make run sensors sane and adjust on_edit to just use ui as ctx (so two run calls needed)

This commit is contained in:
2025-09-24 22:46:55 -04:00
parent 3463682d62
commit 443e13f094
4 changed files with 78 additions and 82 deletions

View File

@@ -155,8 +155,7 @@ impl Client {
let switch_button = |color, to, label| {
let rect = rect(color)
.ctx::<Client>()
.id_on(Sense::click(), move |id, ctx, _| {
.id_on(Sense::click(), move |id, ctx: &mut Client, _| {
ctx.ui[main].inner.set_static(to);
ctx.ui[id].color = color.darker(0.3);
})
@@ -212,7 +211,8 @@ impl Client {
}
if input_changed {
let window_size = self.window_size();
run_sensors(self, &cursor_state, window_size);
SensorModule::run(&mut self.ui, &cursor_state, window_size);
SensorModule::run(self, &cursor_state, window_size);
}
match event {
WindowEvent::CloseRequested => event_loop.exit(),