quickshell: fix tray hover switching same contextMenu dropdown
When hovering between tray icons, update menu content in-place instead of calling toggleDropdown which closes the visible menu. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
656a1fa4ed
commit
5e72fdf038
1 changed files with 11 additions and 2 deletions
|
|
@ -1007,6 +1007,14 @@ in
|
|||
if (bar.activeDropdown) {
|
||||
bar.activeDropdown.resetAutoClose();
|
||||
if (modelData.hasMenu && !(bar.activeDropdown === contextMenu && contextMenu.trayItem === modelData)) {
|
||||
if (bar.activeDropdown === contextMenu) {
|
||||
// Same dropdown, just switch content
|
||||
let pos = parent.mapToItem(bar.contentItem, parent.width / 2, 0);
|
||||
contextMenu.dropdownX = pos.x;
|
||||
contextMenu.trayItem = modelData;
|
||||
menuOpener.menu = modelData.menu;
|
||||
contextMenu.resetAutoClose();
|
||||
} else {
|
||||
bar.toggleDropdown(contextMenu, function() {
|
||||
let pos = parent.mapToItem(bar.contentItem, parent.width / 2, 0);
|
||||
contextMenu.dropdownX = pos.x;
|
||||
|
|
@ -1017,6 +1025,7 @@ in
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue