quickshell: fix tray popup anchor and menu display
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
9dc4067a59
commit
88c2b7b107
1 changed files with 22 additions and 16 deletions
|
|
@ -656,18 +656,17 @@ in
|
||||||
|
|
||||||
PopupWindow {
|
PopupWindow {
|
||||||
id: trayPopup
|
id: trayPopup
|
||||||
anchor.window: bar
|
anchor.item: trayToggle
|
||||||
anchor.adjustment: PopupAdjustment.None
|
anchor.edges: Edges.Bottom | Edges.Right
|
||||||
|
anchor.gravity: Edges.Bottom | Edges.Left
|
||||||
|
anchor.adjustment: PopupAdjustment.Slide
|
||||||
visible: false
|
visible: false
|
||||||
color: "transparent"
|
color: "transparent"
|
||||||
implicitWidth: trayContent.width + 2
|
implicitWidth: trayRow.width + 24
|
||||||
implicitHeight: trayContent.height + 2
|
implicitHeight: 36
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: trayContent
|
anchors.fill: parent
|
||||||
anchors.centerIn: parent
|
|
||||||
width: trayRow.width + 24
|
|
||||||
height: 36
|
|
||||||
color: "#${c.base00}"
|
color: "#${c.base00}"
|
||||||
border.color: "#${c.base03}"
|
border.color: "#${c.base03}"
|
||||||
border.width: 1
|
border.width: 1
|
||||||
|
|
@ -681,21 +680,28 @@ in
|
||||||
Repeater {
|
Repeater {
|
||||||
model: SystemTray.items
|
model: SystemTray.items
|
||||||
|
|
||||||
Image {
|
Item {
|
||||||
required property var modelData
|
required property var modelData
|
||||||
source: modelData.icon
|
Layout.preferredWidth: 20
|
||||||
Layout.preferredWidth: 18
|
Layout.preferredHeight: 20
|
||||||
Layout.preferredHeight: 18
|
|
||||||
smooth: true
|
Image {
|
||||||
|
anchors.fill: parent
|
||||||
|
source: modelData.icon
|
||||||
|
sourceSize.width: 20
|
||||||
|
sourceSize.height: 20
|
||||||
|
smooth: true
|
||||||
|
mipmap: true
|
||||||
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||||
onClicked: (event) => {
|
onClicked: (event) => {
|
||||||
if (event.button === Qt.RightButton && parent.modelData.hasMenu) {
|
if (event.button === Qt.RightButton && modelData.hasMenu) {
|
||||||
parent.modelData.display(trayPopup, mouse.x, mouse.y);
|
modelData.display(bar, event.x, event.y);
|
||||||
} else {
|
} else {
|
||||||
parent.modelData.activate();
|
modelData.activate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue