From 46119048c201e433495d31e037abc3e96db9530c Mon Sep 17 00:00:00 2001 From: pjht Date: Thu, 1 Feb 2024 18:37:32 -0600 Subject: [PATCH] Properly mark front panel state as changed in widget response --- src/frontpanel.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/frontpanel.rs b/src/frontpanel.rs index 94d297d..76263ef 100644 --- a/src/frontpanel.rs +++ b/src/frontpanel.rs @@ -98,7 +98,7 @@ impl Widget for &mut Frontpanel<'_> { ); let led_textures = led::Textures::new(self.textures.led_on.clone(), self.textures.led_off.clone()); - let resp = ui.allocate_response(vec2(800.0, 333.0), Sense::click()); + let mut resp = ui.allocate_response(vec2(800.0, 333.0), Sense::click()); resp.request_focus(); let fp_rect = resp.rect; ui.allocate_ui_at_rect(fp_rect, |ui| { @@ -136,6 +136,7 @@ impl Widget for &mut Frontpanel<'_> { { self.state.power = !power_inv; self.interaction = Some(FrontpanelInteraction::Power(self.state.power)); + resp.mark_changed(); }; }); } @@ -162,6 +163,7 @@ impl Widget for &mut Frontpanel<'_> { { self.state.ad_sws = (self.state.ad_sws & !(bit_mask)) | (u16::from(sw_state) << (16 - i)); + resp.mark_changed(); }; }); } @@ -206,6 +208,7 @@ impl Widget for &mut Frontpanel<'_> { _ => unreachable!(), }; self.interaction = Some(FrontpanelInteraction::ActionSw(sw, *state)); + resp.mark_changed(); }; }); }