Fix hover, systray menu and theming
This commit is contained in:
@@ -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
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user