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

0001 /*
0002     SPDX-FileCopyrightText: 2019 Marco Martin <mart@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 import QtQuick
0008 import QtQuick.Layouts
0009 import QtQuick.Controls as QQC2
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 
0016 Kirigami.FormLayout {
0017     id: root
0018 
0019     property alias cfg_showLegend: showSensorsLegendCheckbox.checked
0020     property alias cfg_fromAngle: fromAngleSpin.value
0021     property alias cfg_toAngle: toAngleSpin.value
0022     property alias cfg_smoothEnds: smoothEndsCheckbox.checked
0023 
0024     property alias cfg_rangeAuto: rangeAutoCheckbox.checked
0025     property alias cfg_rangeFrom: rangeFromSpin.value
0026     property alias cfg_rangeFromUnit: rangeFromSpin.unit
0027     property alias cfg_rangeFromMultiplier: rangeFromSpin.multiplier
0028     property alias cfg_rangeTo: rangeToSpin.value
0029     property alias cfg_rangeToUnit: rangeToSpin.unit
0030     property alias cfg_rangeToMultiplier: rangeToSpin.multiplier
0031 
0032     QQC2.CheckBox {
0033         id: showSensorsLegendCheckbox
0034         text: i18n("Show Sensors Legend")
0035     }
0036     QQC2.SpinBox {
0037         id: fromAngleSpin
0038         Kirigami.FormData.label: i18n("Start from Angle:")
0039         from: -180
0040         to: 360
0041         editable: true
0042         textFromValue: function(value, locale) {
0043             return i18nc("angle degrees", "%1°", value);
0044         }
0045         valueFromText: function(text, locale) {
0046             return Number.fromLocaleString(locale, text.replace(i18nc("angle degrees", "°"), ""));
0047         }
0048     }
0049     QQC2.SpinBox {
0050         id: toAngleSpin
0051         Kirigami.FormData.label: i18n("Total Pie Angle:")
0052         from: 0
0053         to: 360
0054         editable: true
0055         textFromValue: function(value, locale) {
0056             return i18nc("angle", "%1°", value);
0057         }
0058         valueFromText: function(text, locale) {
0059             return Number.fromLocaleString(locale, text.replace(i18nc("angle degrees", "°"), ""));
0060         }
0061     }
0062     QQC2.CheckBox {
0063         id: smoothEndsCheckbox
0064         text: i18n("Rounded Lines")
0065     }
0066 
0067     QQC2.CheckBox {
0068         id: rangeAutoCheckbox
0069         text: i18n("Automatic Data Range")
0070     }
0071     Faces.SensorRangeSpinBox {
0072         id: rangeFromSpin
0073         Kirigami.FormData.label: i18n("From:")
0074         Layout.preferredWidth: Kirigami.Units.gridUnit * 10
0075         enabled: !rangeAutoCheckbox.checked
0076         sensors: controller.highPrioritySensorIds
0077     }
0078     Faces.SensorRangeSpinBox {
0079         id: rangeToSpin
0080         Kirigami.FormData.label: i18n("To:")
0081         Layout.preferredWidth: Kirigami.Units.gridUnit * 10
0082         enabled: !rangeAutoCheckbox.checked
0083         sensors: controller.highPrioritySensorIds
0084     }
0085 }