Warning, /plasma/libksysguard/faces/facepackages/textonly/contents/ui/FullRepresentation.qml is written in an unsupported language. File is not indexed.

0001 /*
0002     SPDX-FileCopyrightText: 2019 Marco Martin <mart@kde.org>
0003     SPDX-FileCopyrightText: 2019 David Edmundson <davidedmundson@kde.org>
0004     SPDX-FileCopyrightText: 2019 Arjen Hiemstra <ahiemstra@heimr.nl>
0005 
0006     SPDX-License-Identifier: LGPL-2.0-or-later
0007 */
0008 
0009 import QtQuick
0010 import QtQuick.Layouts
0011 
0012 import org.kde.kirigami as Kirigami
0013 
0014 import org.kde.ksysguard.sensors as Sensors
0015 import org.kde.ksysguard.faces as Faces
0016 
0017 import org.kde.quickcharts as Charts
0018 import org.kde.quickcharts.controls as ChartsControls
0019 
0020 Faces.SensorFace {
0021     id: root
0022 
0023     // Arbitrary minimumWidth to make easier to align plasmoids in a predictable way
0024     Layout.minimumWidth: Kirigami.Units.gridUnit * 8
0025     Layout.preferredWidth: titleMetrics.width
0026 
0027     contentItem: ColumnLayout {
0028         spacing: 0
0029 
0030         Kirigami.Heading {
0031             id: heading
0032             Layout.fillWidth: true
0033             horizontalAlignment: Text.AlignHCenter
0034             elide: Text.ElideRight
0035             text: root.controller.title
0036             visible: root.controller.showTitle && text.length > 0
0037             level: 2
0038             TextMetrics {
0039                 id: titleMetrics
0040                 font: heading.font
0041                 text: heading.text
0042             }
0043         }
0044 
0045         Item {
0046             Layout.fillWidth: true;
0047             Layout.fillHeight: true;
0048             Layout.minimumHeight: heading.visible ? Kirigami.Units.largeSpacing : 0
0049         }
0050 
0051         GroupedText {
0052             totalSensorIds: root.controller.totalSensors
0053             highPrioritySensorIds: root.controller.highPrioritySensorIds
0054             lowPrioritySensorIds: root.controller.lowPrioritySensorIds
0055             showGroups: root.controller.faceConfiguration.groupByTotal
0056             colorSource: root.colorSource
0057             totalHeight: root.height
0058             updateRateLimit: root.controller.updateRateLimit
0059             sensorLabels: root.controller.sensorLabels
0060         }
0061 
0062         Item {
0063             Layout.fillWidth: true;
0064             Layout.fillHeight: true;
0065             // Trick ColumnLayout into layouting this spacer and the one above
0066             // the same height. Apparently if only minimumHeight is set
0067             // ColumnLayout will still use that as "weight" for sizing.
0068             Layout.preferredHeight: heading.visible ? Kirigami.Units.largeSpacing : 0
0069         }
0070     }
0071 }