Differential D28487 Diff 79120 applets/systemmonitor/systemmonitor/faces/textonly/contents/ui/CompactRepresentation.qml
Changeset View
Changeset View
Standalone View
Standalone View
applets/systemmonitor/systemmonitor/faces/textonly/contents/ui/CompactRepresentation.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2019 Marco Martin <mart@kde.org> | ||||
3 | * Copyright 2019 David Edmundson <davidedmundson@kde.org> | ||||
4 | * Copyright 2019 Arjen Hiemstra <ahiemstra@heimr.nl> | ||||
5 | * | ||||
6 | * This program is free software; you can redistribute it and/or modify | ||||
7 | * it under the terms of the GNU Library General Public License as | ||||
8 | * published by the Free Software Foundation; either version 2, or | ||||
9 | * (at your option) any later version. | ||||
10 | * | ||||
11 | * This program is distributed in the hope that it will be useful, | ||||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
14 | * GNU General Public License for more details | ||||
15 | * | ||||
16 | * You should have received a copy of the GNU Library General Public | ||||
17 | * License along with this program; if not, write to the | ||||
18 | * Free Software Foundation, Inc., | ||||
19 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
20 | */ | ||||
21 | | ||||
22 | import QtQuick 2.9 | ||||
23 | import QtQuick.Layouts 1.1 | ||||
24 | | ||||
25 | import org.kde.kirigami 2.8 as Kirigami | ||||
26 | | ||||
27 | import org.kde.ksysguard.sensors 1.0 as Sensors | ||||
28 | import org.kde.quickcharts 1.0 as Charts | ||||
29 | import org.kde.quickcharts.controls 1.0 as ChartsControls | ||||
30 | import org.kde.plasma.core 2.0 as PlasmaCore | ||||
31 | | ||||
32 | ColumnLayout | ||||
33 | { | ||||
34 | id: root | ||||
35 | | ||||
36 | Layout.minimumWidth: plasmoid.formFactor == PlasmaCore.Types.Vertical ? Kirigami.Units.gridUnit : Kirigami.Units.gridUnit * 2 | ||||
37 | | ||||
38 | Repeater { | ||||
39 | model: plasmoid.configuration.sensorIds | ||||
40 | | ||||
41 | ChartsControls.LegendDelegate { | ||||
42 | Layout.fillWidth: true | ||||
43 | | ||||
44 | name: sensor.shortName | ||||
45 | value: sensor.formattedValue | ||||
46 | colorVisible: false | ||||
47 | colorWidth: 0 | ||||
48 | | ||||
49 | layoutWidth: root.width | ||||
50 | valueWidth: Kirigami.Units.gridUnit * 2 | ||||
51 | | ||||
52 | Sensors.Sensor { | ||||
53 | id: sensor | ||||
54 | sensorId: modelData | ||||
55 | } | ||||
56 | } | ||||
57 | } | ||||
58 | | ||||
59 | Item { Layout.fillWidth: true; Layout.fillHeight: true } | ||||
60 | } |