summaryrefslogtreecommitdiff
path: root/qml/Systray.qml
blob: 8fb92cef4d13df81aa2cb20c431b73af158afe96 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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)
                }
            }
        }
    }
}