forked from 1b-agent/opencadstudio-upstream
fix(statusbar): keep the cursor visible over a disabled menu row
A greyed-out option in a status-bar menu made the mouse pointer vanish. A disabled button reports no mouse interaction at all, and a menu is an overlay: when the overlay reports none, the cursor is decided by whatever lies beneath it, which over the drawing is the canvas hiding the pointer so it can draw the crosshair itself. Enabled rows were fine only because they ask for a pointer and so never fall through. Every row now answers for the cursor over it, doing something or not. `mouse_area` fills in only where the content stays silent, so an enabled row keeps the pointer it asked for. Fixed for every status-bar menu rather than the one that showed it: they all build their rows through the same place, and the next menu with a disabled row would have had the same hole. Closes #684 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
6e3356fb27
commit
3d5f400b9d
1 file changed
+13
-1
@@ -38,7 +38,19 @@ pub fn menu_bar<'a>(
|
||||
) -> Element<'a, Message> {
|
||||
let items = entries
|
||||
.into_iter()
|
||||
.map(|entry| Item::new(entry.content).close_on_click(entry.close_on_click))
|
||||
.map(|entry| {
|
||||
// Every row answers for the cursor over it, even one that does
|
||||
// nothing. A disabled button reports no interaction at all, and the
|
||||
// menu is an overlay: when the overlay reports none, the cursor is
|
||||
// decided by what lies beneath, which over the drawing is the
|
||||
// canvas hiding it for the crosshair. Hovering a greyed-out option
|
||||
// therefore made the pointer vanish. `mouse_area` only fills in
|
||||
// where the content stays silent, so an enabled row keeps its own
|
||||
// pointer. (#684)
|
||||
let content = iced::widget::mouse_area(entry.content)
|
||||
.interaction(iced::mouse::Interaction::Idle);
|
||||
Item::new(content).close_on_click(entry.close_on_click)
|
||||
})
|
||||
.collect();
|
||||
let menu = Menu::new(items)
|
||||
.width(Length::Fixed(width))
|
||||
|
||||
Reference in new issue
Block a user