summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Andrew Baldwin <andrew@boldfriend.org>2025-02-21 20:39:59 -0800
committerLibravatar Andrew Baldwin <andrew@boldfriend.org>2025-02-21 20:39:59 -0800
commit7916a9c2272a3d6d89e7545b33e2991657ad5990 (patch)
treeaed08ce8150d35094460ce0d2157e97c2ecd969a
parent9cba92f57f5686f5295cb3430a3787aa3694a1fc (diff)
downloadiced-7916a9c2272a3d6d89e7545b33e2991657ad5990.tar.gz
iced-7916a9c2272a3d6d89e7545b33e2991657ad5990.tar.bz2
iced-7916a9c2272a3d6d89e7545b33e2991657ad5990.zip
Nit fixes.
-rw-r--r--core/src/widget/operation/focusable.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/core/src/widget/operation/focusable.rs b/core/src/widget/operation/focusable.rs
index 49c574c4..44c9d647 100644
--- a/core/src/widget/operation/focusable.rs
+++ b/core/src/widget/operation/focusable.rs
@@ -285,15 +285,15 @@ pub fn is_focused(target: Id) -> impl Operation<bool> {
_bounds: Rectangle,
operate_on_children: &mut dyn FnMut(&mut dyn Operation<bool>),
) {
+ if self.is_focused.is_some() {
+ return;
+ }
+
operate_on_children(self);
}
fn finish(&self) -> Outcome<bool> {
- if let Some(is_focused) = &self.is_focused {
- Outcome::Some(*is_focused)
- } else {
- Outcome::None
- }
+ self.is_focused.map_or(Outcome::None, Outcome::Some)
}
}