diff options
author | 2024-10-25 15:40:05 +0200 | |
---|---|---|
committer | 2024-11-05 23:52:58 +0100 | |
commit | 752403d70c851ece620c4007710062b158e8dec3 (patch) | |
tree | 8d98a4100dec46c123edd3d3fa4966110da6003c /widget/src/checkbox.rs | |
parent | 7fbc195b11f9a858bcc8f56f76907af82c966c26 (diff) | |
download | iced-752403d70c851ece620c4007710062b158e8dec3.tar.gz iced-752403d70c851ece620c4007710062b158e8dec3.tar.bz2 iced-752403d70c851ece620c4007710062b158e8dec3.zip |
Split `Shell::request_redraw` into two different methods
Diffstat (limited to 'widget/src/checkbox.rs')
-rw-r--r-- | widget/src/checkbox.rs | 12 |
1 files changed, 5 insertions, 7 deletions
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 |