Hover on MenuBar should activate menu if a menu is already open

Fixes #7822
This commit is contained in:
Olivier Goffart 2025-03-28 17:23:05 +01:00
parent fa650ed5ec
commit 6010cf724c
12 changed files with 105 additions and 33 deletions

View file

@ -13,7 +13,8 @@ export component MenuBarItemBase {
in property <int> font-weight <=> label.font-weight;
in property <length> border-radius <=> background-layer.border-radius;
callback clicked <=> touch-area.clicked;
callback clicked;
callback hovered;
background-layer := Rectangle {
background: root.default-background;
@ -30,6 +31,18 @@ export component MenuBarItemBase {
color: root.default-foreground;
}
}
pointer-event(event) => {
if event.kind == PointerEventKind.down {
root.clicked();
}
}
changed has-hover => {
if self.has-hover {
root.hovered();
}
}
}
}