Changeset View
Changeset View
Standalone View
Standalone View
applets/binary-clock/package/contents/ui/configGeneral.qml
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright 2014 Joseph Wenninger <jowenn@kde.org> | ||||
3 | * | ||||
4 | * Based on analog-clock configGeneral.qml: | ||||
5 | * Copyright 2013 David Edmundson <davidedmundson@kde.org> | ||||
6 | * | ||||
7 | * This program is free software; you can redistribute it and/or modify | ||||
8 | * it under the terms of the GNU General Public License as published by | ||||
9 | * the Free Software Foundation; either version 2 of the License, or | ||||
10 | * (at your option) any later version. | ||||
11 | * | ||||
12 | * This program is distributed in the hope that it will be useful, | ||||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
15 | * GNU General Public License for more details. | ||||
16 | * | ||||
17 | * You should have received a copy of the GNU General Public License | ||||
18 | * along with this program; if not, write to the Free Software | ||||
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | ||||
20 | */ | ||||
21 | | ||||
22 | import QtQuick 2.0 | ||||
23 | import QtQuick.Controls 1.0 as QtControls | ||||
24 | import QtQuick.Dialogs 1.1 | ||||
25 | import QtQuick.Layouts 1.1 | ||||
26 | | ||||
27 | | ||||
28 | QtControls.GroupBox { | ||||
29 | width: childrenRect.width | ||||
30 | height: childrenRect.height | ||||
31 | | ||||
32 | flat: true | ||||
33 | title: i18n("Appearance") | ||||
34 | | ||||
35 | property alias cfg_showGrid: showGridCheckBox.checked | ||||
36 | property alias cfg_showOffLeds: showOffLedsCheckBox.checked | ||||
37 | property alias cfg_showSeconds: showSecondsCheckBox.checked | ||||
38 | property alias cfg_useCustomColorForActive: useCustomColorForActiveCheckBox.checked | ||||
39 | property alias cfg_customColorForActive: customColorForActive.color | ||||
40 | property alias cfg_useCustomColorForInactive: useCustomColorForInactiveCheckBox.checked | ||||
41 | property alias cfg_customColorForInactive: customColorForInactive.color | ||||
42 | property alias cfg_useCustomColorForGrid: useCustomColorForGridCheckBox.checked | ||||
43 | property alias cfg_customColorForGrid: customColorForGrid.color | ||||
44 | | ||||
45 | ColorDialog { | ||||
46 | property var element; | ||||
47 | id: colorDialog | ||||
48 | visible: false | ||||
49 | modality: Qt.WindowModal | ||||
50 | title: "Choose a color" | ||||
51 | showAlphaChannel: true | ||||
52 | onAccepted: { element.color=color } | ||||
53 | onRejected: { } | ||||
54 | } | ||||
55 | | ||||
56 | | ||||
57 | ColumnLayout { | ||||
58 | QtControls.CheckBox { | ||||
59 | id: showGridCheckBox | ||||
60 | text: i18n("Draw grid") | ||||
61 | } | ||||
62 | QtControls.CheckBox { | ||||
63 | id: showOffLedsCheckBox | ||||
64 | text: i18n("Show inactive LEDs:") | ||||
65 | } | ||||
66 | QtControls.CheckBox { | ||||
67 | id: showSecondsCheckBox | ||||
68 | text: i18n("Display seconds") | ||||
69 | } | ||||
70 | QtControls.Label { | ||||
71 | text: i18n("Colors:") | ||||
72 | } | ||||
73 | GridLayout { | ||||
74 | columns: 2; | ||||
75 | QtControls.CheckBox { | ||||
76 | id: useCustomColorForActiveCheckBox | ||||
77 | text: i18n("Use custom color for active LEDs") | ||||
78 | } | ||||
79 | Rectangle { | ||||
80 | width:20 | ||||
81 | height:20 | ||||
82 | id:customColorForActive | ||||
83 | MouseArea { | ||||
84 | anchors.fill: parent | ||||
85 | onClicked: { | ||||
86 | colorDialog.element=parent; | ||||
87 | colorDialog.color=parent.color; | ||||
88 | colorDialog.open(); | ||||
89 | } | ||||
90 | } | ||||
91 | } | ||||
92 | | ||||
93 | QtControls.CheckBox { | ||||
94 | id: useCustomColorForInactiveCheckBox | ||||
95 | text: i18n("Use custom color for inactive LEDs") | ||||
96 | } | ||||
97 | Rectangle { | ||||
98 | width:20 | ||||
99 | height:20 | ||||
100 | id:customColorForInactive | ||||
101 | MouseArea { | ||||
102 | anchors.fill: parent | ||||
103 | onClicked: { | ||||
104 | colorDialog.element=parent; | ||||
105 | colorDialog.color=parent.color; | ||||
106 | colorDialog.open(); | ||||
107 | } | ||||
108 | } | ||||
109 | } | ||||
110 | | ||||
111 | QtControls.CheckBox { | ||||
112 | id: useCustomColorForGridCheckBox | ||||
113 | text: i18n("Use custom color for grid") | ||||
114 | } | ||||
115 | Rectangle { | ||||
116 | width:20 | ||||
117 | height:20 | ||||
118 | id:customColorForGrid | ||||
119 | MouseArea { | ||||
120 | anchors.fill: parent | ||||
121 | onClicked: { | ||||
122 | colorDialog.element=parent; | ||||
123 | colorDialog.color=parent.color; | ||||
124 | colorDialog.open(); | ||||
125 | } | ||||
126 | } | ||||
127 | } | ||||
128 | } | ||||
129 | } | ||||
130 | } |