diff options
| author | Gregor Kleen <gkleen@yggdrasil.li> | 2025-08-31 13:06:25 +0200 |
|---|---|---|
| committer | Gregor Kleen <gkleen@yggdrasil.li> | 2025-08-31 13:06:25 +0200 |
| commit | 8cf207d3bfcb996c4afa4139e2741b039a313b78 (patch) | |
| tree | 7441cb11d6ba5f9fa900c558b04fddd77b2737a5 /accounts/gkleen@sif/shell/quickshell/SystemTray.qml | |
| parent | 9fc966ff7726d01267a6220483fb005c0efaa9c0 (diff) | |
| download | nixos-8cf207d3bfcb996c4afa4139e2741b039a313b78.tar nixos-8cf207d3bfcb996c4afa4139e2741b039a313b78.tar.gz nixos-8cf207d3bfcb996c4afa4139e2741b039a313b78.tar.bz2 nixos-8cf207d3bfcb996c4afa4139e2741b039a313b78.tar.xz nixos-8cf207d3bfcb996c4afa4139e2741b039a313b78.zip | |
...
Diffstat (limited to 'accounts/gkleen@sif/shell/quickshell/SystemTray.qml')
| -rw-r--r-- | accounts/gkleen@sif/shell/quickshell/SystemTray.qml | 48 |
1 files changed, 46 insertions, 2 deletions
diff --git a/accounts/gkleen@sif/shell/quickshell/SystemTray.qml b/accounts/gkleen@sif/shell/quickshell/SystemTray.qml index a02a81fd..afed4bf0 100644 --- a/accounts/gkleen@sif/shell/quickshell/SystemTray.qml +++ b/accounts/gkleen@sif/shell/quickshell/SystemTray.qml | |||
| @@ -17,7 +17,11 @@ Item { | |||
| 17 | spacing: 0 | 17 | spacing: 0 |
| 18 | 18 | ||
| 19 | Repeater { | 19 | Repeater { |
| 20 | model: SystemTray.items.values | 20 | model: { |
| 21 | var trayItems = Array.from(SystemTray.items.values).filter(item => item.status !== Status.Passive); | ||
| 22 | trayItems.sort((a, b) => a.category !== b.category ? b.category - a.category : a.id.localeCompare(b.id)) | ||
| 23 | return trayItems; | ||
| 24 | } | ||
| 21 | 25 | ||
| 22 | delegate: Item { | 26 | delegate: Item { |
| 23 | property var trayItem: modelData | 27 | property var trayItem: modelData |
| @@ -59,7 +63,7 @@ Item { | |||
| 59 | anchors.fill: parent | 63 | anchors.fill: parent |
| 60 | acceptedButtons: Qt.LeftButton | Qt.RightButton | 64 | acceptedButtons: Qt.LeftButton | Qt.RightButton |
| 61 | hoverEnabled: true | 65 | hoverEnabled: true |
| 62 | cursorShape: Qt.PointingHandCursor | 66 | cursorShape: trayItem.onlyMenu ? Qt.ArrowCursor : Qt.PointingHandCursor |
| 63 | onClicked: mouse => { | 67 | onClicked: mouse => { |
| 64 | if (!trayItem) | 68 | if (!trayItem) |
| 65 | return | 69 | return |
| @@ -85,6 +89,46 @@ Item { | |||
| 85 | } | 89 | } |
| 86 | } | 90 | } |
| 87 | } | 91 | } |
| 92 | |||
| 93 | PopupWindow { | ||
| 94 | anchor { | ||
| 95 | item: trayItemArea | ||
| 96 | edges: Edges.Bottom | ||
| 97 | } | ||
| 98 | visible: (trayItem.tooltipTitle || trayItem.tooltipDescription) && trayItemArea.containsMouse && !menuAnchor.visible | ||
| 99 | |||
| 100 | color: "black" | ||
| 101 | |||
| 102 | implicitWidth: Math.max(tooltipTitle.contentWidth, tooltipDescription.contentWidth) + 16 | ||
| 103 | implicitHeight: tooltipTitle.contentHeight + tooltipDescription.contentHeight + 16 | ||
| 104 | |||
| 105 | WrapperItem { | ||
| 106 | margin: 8 | ||
| 107 | |||
| 108 | Column { | ||
| 109 | Text { | ||
| 110 | id: tooltipTitle | ||
| 111 | |||
| 112 | font.pointSize: 10 | ||
| 113 | font.family: "Fira Sans" | ||
| 114 | font.bold: true | ||
| 115 | color: "white" | ||
| 116 | |||
| 117 | text: trayItem.tooltipTitle | ||
| 118 | } | ||
| 119 | |||
| 120 | Text { | ||
| 121 | id: tooltipDescription | ||
| 122 | |||
| 123 | font.pointSize: 10 | ||
| 124 | font.family: "Fira Sans" | ||
| 125 | color: "white" | ||
| 126 | |||
| 127 | text: trayItem.tooltipDescription | ||
| 128 | } | ||
| 129 | } | ||
| 130 | } | ||
| 131 | } | ||
| 88 | } | 132 | } |
| 89 | } | 133 | } |
| 90 | } | 134 | } |
