Fix hover, systray menu and theming

This commit is contained in:
Amaro Lopes
2025-09-24 17:02:46 -03:00
parent 161988cbb6
commit c66d043ece
8 changed files with 116 additions and 53 deletions

View File

@@ -7,6 +7,7 @@ import Quickshell
import Quickshell.Widgets
import Quickshell.Services.SystemTray
import qs.Common
import qs.Services
WrapperRectangle {
id: systrayRoot
@@ -60,24 +61,26 @@ WrapperRectangle {
source: systrayItem.iconSource
}
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton
hoverEnabled: true
onEntered: {
PopUpHover.start(systrayItem,"systray")
}
onExited: {
PopUpHover.exit()
}
onClicked: (mouse) => {
if (mouse.button === Qt.RightButton) {
const globalPos = mapToGlobal(0, 0);
const currentScreen = parent.monitor
const relativeX = globalPos.x;
menuAnchor.menu = systrayItem.model.menu;
menuAnchor.anchor.window = root;
menuAnchor.anchor.item = systrayItem;
menuAnchor.anchor.rect = Qt.rect(
globalPos.x,
globalPos.y+10,
1,
1
0,
systrayItem.implicitHeight,
0,
0
);
menuAnchor.open();
@@ -97,4 +100,4 @@ WrapperRectangle {
id: menuAnchor
}
}
}