quickshell: reset auto-close timer when hovering between widgets

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
rope 2026-05-26 21:06:16 +01:00
parent 526f673f7d
commit 05ada14442

View file

@ -576,14 +576,6 @@ in
property var activeDropdown: null
HoverHandler {
onHoveredChanged: {
if (hovered && bar.activeDropdown) {
bar.activeDropdown.resetAutoClose();
}
}
}
function closeAllDropdowns() {
if (activeDropdown && activeDropdown.visible) {
activeDropdown.animateClose();
@ -671,7 +663,12 @@ in
anchors.fill: parent
hoverEnabled: true
onClicked: bar.toggleDropdown(calPopup)
onEntered: { if (bar.activeDropdown && bar.activeDropdown !== calPopup) bar.toggleDropdown(calPopup); }
onEntered: {
if (bar.activeDropdown) {
if (bar.activeDropdown !== calPopup) bar.toggleDropdown(calPopup);
else bar.activeDropdown.resetAutoClose();
}
}
}
}
@ -816,7 +813,12 @@ in
anchors.fill: parent
hoverEnabled: true
onClicked: netWidget.openNetDropdown()
onEntered: { if (bar.activeDropdown && bar.activeDropdown !== netDropdown) netWidget.openNetDropdown(); }
onEntered: {
if (bar.activeDropdown) {
if (bar.activeDropdown !== netDropdown) netWidget.openNetDropdown();
else bar.activeDropdown.resetAutoClose();
}
}
}
}
@ -947,7 +949,12 @@ in
anchors.fill: parent
hoverEnabled: true
onClicked: batteryWidget.openBatteryDropdown()
onEntered: { if (bar.activeDropdown && bar.activeDropdown !== batteryDropdown) batteryWidget.openBatteryDropdown(); }
onEntered: {
if (bar.activeDropdown) {
if (bar.activeDropdown !== batteryDropdown) batteryWidget.openBatteryDropdown();
else bar.activeDropdown.resetAutoClose();
}
}
}
}
''}
@ -988,13 +995,16 @@ in
hoverEnabled: true
acceptedButtons: Qt.NoButton
onEntered: {
if (bar.activeDropdown && modelData.hasMenu && !(bar.activeDropdown === contextMenu && contextMenu.trayItem === modelData)) {
bar.toggleDropdown(contextMenu, function() {
let pos = parent.mapToItem(bar.contentItem, parent.width / 2, 0);
contextMenu.dropdownX = pos.x;
contextMenu.trayItem = modelData;
menuOpener.menu = modelData.menu;
});
if (bar.activeDropdown) {
bar.activeDropdown.resetAutoClose();
if (modelData.hasMenu && !(bar.activeDropdown === contextMenu && contextMenu.trayItem === modelData)) {
bar.toggleDropdown(contextMenu, function() {
let pos = parent.mapToItem(bar.contentItem, parent.width / 2, 0);
contextMenu.dropdownX = pos.x;
contextMenu.trayItem = modelData;
menuOpener.menu = modelData.menu;
});
}
}
}
}