Differential D28487 Diff 79120 applets/systemmonitor/systemmonitor/package/contents/ui/CompactRepresentation.qml
Changeset View
Changeset View
Standalone View
Standalone View
applets/systemmonitor/systemmonitor/package/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 | import org.kde.plasma.core 2.0 as PlasmaCore | ||||
25 | import org.kde.quickcharts 1.0 as Charts | ||||
26 | import org.kde.kirigami 2.8 as Kirigami | ||||
27 | | ||||
28 | Item { | ||||
29 | Layout.fillWidth: chartFace.item ? chartFace.item.Layout.fillWidth : false | ||||
30 | Layout.fillHeight: chartFace.item ? chartFace.item.Layout.fillHeight : false | ||||
31 | | ||||
32 | Layout.minimumWidth: chartFace.item ? chartFace.item.Layout.minimumWidth : 0 | ||||
33 | Layout.minimumHeight: chartFace.item ? chartFace.item.Layout.minimumHeight : 0 | ||||
34 | | ||||
35 | Layout.preferredWidth: chartFace.item ? chartFace.item.Layout.preferredWidth : 0 | ||||
36 | Layout.preferredHeight: chartFace.item ? chartFace.item.Layout.preferredHeight : 0 | ||||
37 | | ||||
38 | Layout.maximumWidth: chartFace.item ? chartFace.item.Layout.maximumWidth : 0 | ||||
39 | Layout.maximumHeight: chartFace.item ? chartFace.item.Layout.maximumHeight : 0 | ||||
40 | | ||||
41 | Kirigami.Theme.textColor: PlasmaCore.ColorScope.textColor | ||||
42 | | ||||
43 | Charts.ArraySource { | ||||
44 | id: globalColorSource | ||||
45 | array: plasmoid.configuration.sensorColors | ||||
46 | } | ||||
47 | Loader { | ||||
48 | id: chartFace | ||||
49 | anchors.fill: parent | ||||
50 | source: plasmoid.nativeInterface.compactRepresentationPath | ||||
51 | } | ||||
52 | MouseArea { | ||||
53 | anchors.fill: parent | ||||
54 | onClicked: plasmoid.expanded = !plasmoid.expanded | ||||
55 | } | ||||
56 | } |