mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 18:58:36 +00:00
Hover on MenuBar should activate menu if a menu is already open
Fixes #7822
This commit is contained in:
parent
fa650ed5ec
commit
6010cf724c
12 changed files with 105 additions and 33 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue