From 752403d70c851ece620c4007710062b158e8dec3 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Fri, 25 Oct 2024 15:40:05 +0200 Subject: Split `Shell::request_redraw` into two different methods --- widget/src/checkbox.rs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'widget/src/checkbox.rs') diff --git a/widget/src/checkbox.rs b/widget/src/checkbox.rs index e5dea3cc..6c5d7d6b 100644 --- a/widget/src/checkbox.rs +++ b/widget/src/checkbox.rs @@ -345,13 +345,11 @@ where if let Event::Window(window::Event::RedrawRequested(_now)) = event { self.last_status = Some(current_status); - } else { - match self.last_status { - Some(status) if status != current_status => { - shell.request_redraw(window::RedrawRequest::NextFrame); - } - _ => {} - } + } else if self + .last_status + .is_some_and(|status| status != current_status) + { + shell.request_redraw(); } event::Status::Ignored -- cgit