From bd0ceea108216fc824532d493f961edaf3e617ff Mon Sep 17 00:00:00 2001 From: Fabien Proriol Date: Wed, 28 May 2025 10:33:25 +0200 Subject: Add XDG Systray --- qml/Systray.qml | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 qml/Systray.qml (limited to 'qml/Systray.qml') diff --git a/qml/Systray.qml b/qml/Systray.qml new file mode 100644 index 0000000..8fb92ce --- /dev/null +++ b/qml/Systray.qml @@ -0,0 +1,52 @@ +import QtQuick 2.15 +import QtQuick.Controls 2.15 +import QtQuick.Controls.impl 2.15 +import org.kazoe.xdg 1.0 + +Rectangle { + color: "transparent" + width: view.contentWidth + height: systrayView.height + + StatusNotifierHost { + id: systrayModel + } + + ListView { + id: view + orientation: ListView.Horizontal + anchors.fill: parent + anchors.margins: 2 + model: systrayModel + delegate: Rectangle { + visible: iconName.length && status !== "Passive" + height: view.height + width: visible ? height : 0 + color: "transparent" + + IconImage { + anchors.fill: parent + name: iconName + color: "transparent" + } + + IconImage { + id: overlay + anchors.bottom: parent.bottom + anchors.right: parent.right + width: parent.width / 2 + height: parent.height / 2 + visible: overlayIconName.length + name: overlayIconName + color: "transparent" + } + + MouseArea { + anchors.fill: parent + onClicked: { + systrayModel.activate(0, 0, idItem, 0) + } + } + } + } +} -- cgit v1.2.3