diff options
author | Fabien Proriol <fabien.proriol@kazoe.org> | 2025-05-25 17:58:09 +0200 |
---|---|---|
committer | Fabien Proriol <fabien.proriol@kazoe.org> | 2025-05-26 18:01:49 +0200 |
commit | 49daa163530ceabc9eaa8911ab96b5f799cfb552 (patch) | |
tree | 080d0b31eafd138cd8d47d5c2a52b75d3cfa6f28 /qml/SystrayView.qml |
Initial Commit
Diffstat (limited to 'qml/SystrayView.qml')
-rw-r--r-- | qml/SystrayView.qml | 32 |
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}) + } + } +} |