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

0001 /*
0002     SPDX-FileCopyrightText: 2021 Arjen Hiemstra <ahiemstra@heimr.nl>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005  */
0006 
0007 import QtQuick
0008 import QtQuick.Controls
0009 import QtQuick.Layouts
0010 
0011 import org.kde.kirigami as Kirigami
0012 
0013 import org.kde.ksysguard.sensors as Sensors
0014 import org.kde.ksysguard.faces as Faces
0015 import org.kde.ksysguard.formatter as Formatter
0016 
0017 Control {
0018     id: control
0019 
0020     property var controller
0021     property var sensors: []
0022     property var sensorNames: []
0023     property string faceId
0024 
0025     topPadding: 0
0026     bottomPadding: 0
0027     leftPadding: 0
0028     rightPadding: 0
0029 
0030     Faces.FaceLoader {
0031         id: loader
0032         parentController: control.controller
0033         groupName: "FaceGrid"
0034         sensors: control.sensors
0035         faceId: control.faceId
0036         colors: control.controller.sensorColors
0037         labels: control.controller.sensorLabels
0038     }
0039 
0040     Component.onCompleted: updateContentItem()
0041 
0042     Connections {
0043         target: loader.controller
0044         function onFaceIdChanged() {
0045             control.updateContentItem()
0046         }
0047     }
0048 
0049     function updateContentItem() {
0050         loader.controller.fullRepresentation.formFactor = Faces.SensorFace.Constrained;
0051         control.contentItem = loader.controller.fullRepresentation;
0052     }
0053 
0054     Connections {
0055         target: root.controller.faceConfigUi
0056         function onConfigurationChanged() {
0057             loader.controller.reloadFaceConfiguration()
0058         }
0059     }
0060 }