Debian Codegraph @

faces/facepackages/colorgrid/contents/ui/Config.qml

raw
1 /*
2 SPDX-FileCopyrightText: 2021 Arjen Hiemstra <[email protected]>
3 SPDX-FileCopyrightText: 2022 Kai Uwe Broulik <[email protected]>
4
5 SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7
8 import QtQuick
9 import QtQuick.Controls
10 import QtQuick.Layouts
11
12 import org.kde.kirigami as Kirigami
13
14 Kirigami.FormLayout {
15 id: root
16
17 property alias cfg_columnCount: columnCountSpin.value
18 property alias cfg_useSensorColor: sensorColorCheck.checked
19
20 CheckBox {
21 id: sensorColorCheck
22 Kirigami.FormData.label: i18nc("@option:check", "Use sensor color:")
23 }
24
25 SpinBox {
26 id: columnCountSpin
27 Kirigami.FormData.label: i18nc("@label:spinbox", "Number of columns:")
28 editable: true
29 from: 0
30 to: 99999
31
32 textFromValue: function(value, locale) {
33 if (value <= 0) {
34 return i18nc("@label automatic number of columns", "Automatic")
35 }
36 return value.toString()
37 }
38
39 valueFromText: function(value, locale) {
40 return parseInt(value)
41 }
42 }
43 }