From a9cd761d525f25fb8eb5b27047ffa5aebc34e20a Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 8 Oct 2026 18:33:25 +0000 Subject: [PATCH] Fix #316: the section eye stays while the pointer is on it The eye was drawn only while the header itself was hovered; with the pointer on the eye, egui reports the eye (on top) as hovered and not the header, so the eye vanished under the pointer and could not be clicked. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01912WaK6Rmew3wxZuPyX7E8 --- crates/ui-egui/src/widgets.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/widgets.rs b/crates/ui-egui/src/widgets.rs index d89a9ce32..907bae10d 100644 --- a/crates/ui-egui/src/widgets.rs +++ b/crates/ui-egui/src/widgets.rs @@ -270,8 +270,11 @@ pub fn section_header(ui: &mut Ui, id: &str, title: &str, open: bool, enabled: O paint(p, chev, if open { Icon::ChevronDown } else { Icon::ChevronRight }, t.text_label); p.text(pos2(r.left() + 44.0, r.center().y), Align2::LEFT_CENTER, title, t.semibold(14.0), t.text); let mut toggled = None; + // shown while the pointer is anywhere on the header: `resp.hovered()` turns false as soon as the + // pointer is over the eye itself (the eye is on top), which hid the eye before it could be + // clicked (issue #316) if let Some(on) = enabled - && (resp.hovered() || !on) + && (ui.rect_contains_pointer(r) || !on) { let eye = Rect::from_center_size(pos2(r.right() - 34.0, r.center().y), vec2(18.0, 18.0)); let er = ui.interact(eye, ui.id().with(("eye", id)), Sense::click());