summaryrefslogtreecommitdiff
path: root/package/contents/ui/CompactRepresentation.qml
blob: 85d62ee08518b013eb9d4a9632e6a6598679294d (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
import QtQuick 6.0
import QtQuick.Layouts 6.0
import org.kde.plasma.components 3.0 as PlasmaComponents

RowLayout {
    IconUtils { id: icons }
    FormatUtils { id: fmt }
    spacing: 4

    PlasmaComponents.Label {
        text: icons.getDirectionIcon(root.direction)
        font.pointSize: 12
    }

    PlasmaComponents.Label {
        text: icons.getBatteryIcon(root.batterySoc)
        font.pointSize: 12
    }

    PlasmaComponents.Label {
        text: fmt.formatSoc(root.batterySoc)
        font.pointSize: 10
        font.bold: true
    }

    MouseArea {
        anchors.fill: parent
        acceptedButtons: Qt.LeftButton
        onClicked: (mouse) => {
            root.expanded = !root.expanded
        }
    }
}