quickshell: fix tray menu, improve popup styling
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d63693e87a
commit
9dc4067a59
1 changed files with 13 additions and 11 deletions
|
|
@ -634,17 +634,17 @@ in
|
||||||
|
|
||||||
// Tray toggle button
|
// Tray toggle button
|
||||||
Item {
|
Item {
|
||||||
|
id: trayToggle
|
||||||
Layout.preferredWidth: 28
|
Layout.preferredWidth: 28
|
||||||
Layout.preferredHeight: 30
|
Layout.preferredHeight: 30
|
||||||
Layout.rightMargin: 6
|
Layout.rightMargin: 6
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: "\ue0b2"
|
text: trayPopup.visible ? "\u25b6" : "\u25c0"
|
||||||
color: "#${c.base05}"
|
color: "#${c.base05}"
|
||||||
font.family: "FiraMono Nerd Font"
|
font.family: "FiraMono Nerd Font"
|
||||||
font.pixelSize: 13
|
font.pixelSize: 10
|
||||||
textFormat: Text.PlainText
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
@ -657,19 +657,21 @@ in
|
||||||
PopupWindow {
|
PopupWindow {
|
||||||
id: trayPopup
|
id: trayPopup
|
||||||
anchor.window: bar
|
anchor.window: bar
|
||||||
anchor.rect.x: bar.width - 220
|
anchor.adjustment: PopupAdjustment.None
|
||||||
anchor.rect.y: bar.height
|
|
||||||
visible: false
|
visible: false
|
||||||
color: "#${c.base00}"
|
color: "transparent"
|
||||||
implicitWidth: trayRow.width + 24
|
implicitWidth: trayContent.width + 2
|
||||||
implicitHeight: 40
|
implicitHeight: trayContent.height + 2
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
id: trayContent
|
||||||
|
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
|
||||||
radius: 8
|
radius: 6
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
id: trayRow
|
id: trayRow
|
||||||
|
|
@ -691,7 +693,7 @@ in
|
||||||
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 && parent.modelData.hasMenu) {
|
||||||
parent.modelData.menu.open();
|
parent.modelData.display(trayPopup, mouse.x, mouse.y);
|
||||||
} else {
|
} else {
|
||||||
parent.modelData.activate();
|
parent.modelData.activate();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue