summaryrefslogtreecommitdiff
path: root/qml/SystrayView.qml
diff options
context:
space:
mode:
Diffstat (limited to 'qml/SystrayView.qml')
-rw-r--r--qml/SystrayView.qml32
1 files changed, 32 insertions, 0 deletions
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})
+ }
+ }
+}