make run sensors sane and adjust on_edit to just use ui as ctx (so two run calls needed)
This commit is contained in:
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user