From 8cf207d3bfcb996c4afa4139e2741b039a313b78 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Sun, 31 Aug 2025 13:06:25 +0200 Subject: ... --- .../gkleen@sif/shell/quickshell/SystemTray.qml | 48 +++++++++++++++++++++- 1 file changed, 46 insertions(+), 2 deletions(-) (limited to 'accounts/gkleen@sif/shell/quickshell/SystemTray.qml') 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 { spacing: 0 Repeater { - model: SystemTray.items.values + model: { + var trayItems = Array.from(SystemTray.items.values).filter(item => item.status !== Status.Passive); + trayItems.sort((a, b) => a.category !== b.category ? b.category - a.category : a.id.localeCompare(b.id)) + return trayItems; + } delegate: Item { property var trayItem: modelData @@ -59,7 +63,7 @@ Item { anchors.fill: parent acceptedButtons: Qt.LeftButton | Qt.RightButton hoverEnabled: true - cursorShape: Qt.PointingHandCursor + cursorShape: trayItem.onlyMenu ? Qt.ArrowCursor : Qt.PointingHandCursor onClicked: mouse => { if (!trayItem) return @@ -85,6 +89,46 @@ Item { } } } + + PopupWindow { + anchor { + item: trayItemArea + edges: Edges.Bottom + } + visible: (trayItem.tooltipTitle || trayItem.tooltipDescription) && trayItemArea.containsMouse && !menuAnchor.visible + + color: "black" + + implicitWidth: Math.max(tooltipTitle.contentWidth, tooltipDescription.contentWidth) + 16 + implicitHeight: tooltipTitle.contentHeight + tooltipDescription.contentHeight + 16 + + WrapperItem { + margin: 8 + + Column { + Text { + id: tooltipTitle + + font.pointSize: 10 + font.family: "Fira Sans" + font.bold: true + color: "white" + + text: trayItem.tooltipTitle + } + + Text { + id: tooltipDescription + + font.pointSize: 10 + font.family: "Fira Sans" + color: "white" + + text: trayItem.tooltipDescription + } + } + } + } } } } -- cgit v1.2.3