Differential D28487 Diff 82287 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 QtQuick.Controls 2.2 | ||||
25 | import org.kde.plasma.core 2.0 as PlasmaCore | ||||
26 | import org.kde.quickcharts 1.0 as Charts | ||||
27 | | ||||
28 | import org.kde.ksysguard.sensors 1.0 as Sensors | ||||
29 | import org.kde.ksysguard.faces 1.0 as Faces | ||||
30 | | ||||
31 | import org.kde.kirigami 2.8 as Kirigami | ||||
32 | | ||||
33 | Control { | ||||
34 | id: chartFace | ||||
35 | Layout.fillWidth: contentItem ? contentItem.Layout.fillWidth : false | ||||
36 | Layout.fillHeight: contentItem ? contentItem.Layout.fillHeight : false | ||||
37 | | ||||
38 | Layout.minimumWidth: contentItem ? contentItem.Layout.minimumWidth : 0 | ||||
39 | Layout.minimumHeight: contentItem ? contentItem.Layout.minimumHeight : 0 | ||||
40 | | ||||
41 | Layout.preferredWidth: contentItem ? contentItem.Layout.preferredWidth : 0 | ||||
42 | Layout.preferredHeight: contentItem ? contentItem.Layout.preferredHeight : 0 | ||||
43 | | ||||
44 | Layout.maximumWidth: contentItem ? contentItem.Layout.maximumWidth : 0 | ||||
45 | Layout.maximumHeight: contentItem ? contentItem.Layout.maximumHeight : 0 | ||||
46 | | ||||
47 | Kirigami.Theme.textColor: PlasmaCore.ColorScope.textColor | ||||
48 | | ||||
49 | anchors.fill: parent | ||||
50 | contentItem: plasmoid.nativeInterface.faceController.compactRepresentation | ||||
51 | | ||||
52 | MouseArea { | ||||
53 | parent: chartFace | ||||
54 | anchors.fill: parent | ||||
55 | onClicked: plasmoid.expanded = !plasmoid.expanded | ||||
56 | } | ||||
57 | } |