From 49daa163530ceabc9eaa8911ab96b5f799cfb552 Mon Sep 17 00:00:00 2001 From: Fabien Proriol Date: Sun, 25 May 2025 17:58:09 +0200 Subject: Initial Commit --- qml/SystrayView.qml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 qml/SystrayView.qml (limited to 'qml/SystrayView.qml') diff --git a/qml/SystrayView.qml b/qml/SystrayView.qml new file mode 100644 index 0000000..3b21152 --- /dev/null +++ b/qml/SystrayView.qml @@ -0,0 +1,32 @@ +import QtQuick +import QtQuick.Controls +import QtWayland.Compositor +import org.kazoe.desktop +import org.kazoe.xdg + +ListView { + id: systrayView + width: systrayView.contentWidth + orientation: ListView.Horizontal + model: systray + delegate: Item { + id: trayitem + + Component.onCompleted: { + var qmlcode + var c + if(exec.startsWith("qml://")) { + var ur = exec.split("/") + qmlcode = "import " + ur[2] + " " + ur[3] + "; " + ur[4] + " {}" + c = Qt.createQmlObject(qmlcode, trayitem, ur[4]) + } + else + { + console.debug("Item not supported for systray:" + exec) + } + + trayitem.width = Qt.binding(() => {return c.width}) + trayitem.height = Qt.binding(() => {return c.height}) + } + } +} -- cgit v1.2.3