Changeset View
Changeset View
Standalone View
Standalone View
applets/binary-clock/package/contents/ui/configGeneral.qml
Show All 15 Lines | |||||
16 | * | 16 | * | ||
17 | * You should have received a copy of the GNU General Public License | 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 | 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. | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 2.010-1301, USA. | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | import QtQuick 2.0 | 22 | import QtQuick 2.0 | ||
23 | import QtQuick.Controls 1.0 as QtControls | 23 | import QtQuick.Controls 1.0 as QtControls | ||
24 | import QtQuick.Dialogs 1.1 | | |||
25 | import QtQuick.Layouts 1.1 | 24 | import QtQuick.Layouts 1.1 | ||
25 | import org.kde.kquickcontrols 2.0 as KQuickControls | ||||
26 | 26 | | |||
27 | 27 | | |||
28 | QtControls.GroupBox { | 28 | QtControls.GroupBox { | ||
29 | width: childrenRect.width | 29 | width: childrenRect.width | ||
30 | height: childrenRect.height | 30 | height: childrenRect.height | ||
31 | 31 | | |||
32 | flat: true | 32 | flat: true | ||
33 | title: i18n("Appearance") | 33 | title: i18n("Appearance") | ||
34 | 34 | | |||
35 | property alias cfg_showGrid: showGridCheckBox.checked | 35 | property alias cfg_showGrid: showGridCheckBox.checked | ||
36 | property alias cfg_showOffLeds: showOffLedsCheckBox.checked | 36 | property alias cfg_showOffLeds: showOffLedsCheckBox.checked | ||
37 | property alias cfg_showSeconds: showSecondsCheckBox.checked | 37 | property alias cfg_showSeconds: showSecondsCheckBox.checked | ||
38 | property alias cfg_showBcdFormat: showBcdFormatCheckBox.checked | 38 | property alias cfg_showBcdFormat: showBcdFormatCheckBox.checked | ||
39 | property alias cfg_useCustomColorForActive: useCustomColorForActiveCheckBox.checked | 39 | property alias cfg_useCustomColorForActive: useCustomColorForActiveCheckBox.checked | ||
40 | property alias cfg_customColorForActive: customColorForActive.color | 40 | property alias cfg_customColorForActive: customColorForActive.color | ||
41 | property alias cfg_useCustomColorForInactive: useCustomColorForInactiveCheckBox.checked | 41 | property alias cfg_useCustomColorForInactive: useCustomColorForInactiveCheckBox.checked | ||
42 | property alias cfg_customColorForInactive: customColorForInactive.color | 42 | property alias cfg_customColorForInactive: customColorForInactive.color | ||
43 | property alias cfg_useCustomColorForGrid: useCustomColorForGridCheckBox.checked | 43 | property alias cfg_useCustomColorForGrid: useCustomColorForGridCheckBox.checked | ||
44 | property alias cfg_customColorForGrid: customColorForGrid.color | 44 | property alias cfg_customColorForGrid: customColorForGrid.color | ||
45 | 45 | | |||
46 | ColorDialog { | | |||
47 | property var element; | | |||
48 | id: colorDialog | | |||
49 | visible: false | | |||
50 | modality: Qt.WindowModal | | |||
51 | title: "Choose a color" | | |||
52 | showAlphaChannel: true | | |||
53 | onAccepted: { element.color=color } | | |||
54 | onRejected: { } | | |||
55 | } | | |||
56 | | ||||
57 | | ||||
58 | ColumnLayout { | 46 | ColumnLayout { | ||
59 | QtControls.CheckBox { | 47 | QtControls.CheckBox { | ||
60 | id: showGridCheckBox | 48 | id: showGridCheckBox | ||
61 | text: i18n("Draw grid") | 49 | text: i18n("Draw grid") | ||
62 | } | 50 | } | ||
63 | QtControls.CheckBox { | 51 | QtControls.CheckBox { | ||
64 | id: showOffLedsCheckBox | 52 | id: showOffLedsCheckBox | ||
65 | text: i18n("Show inactive LEDs:") | 53 | text: i18n("Show inactive LEDs:") | ||
Show All 10 Lines | 63 | QtControls.Label { | |||
76 | text: i18n("Colors:") | 64 | text: i18n("Colors:") | ||
77 | } | 65 | } | ||
78 | GridLayout { | 66 | GridLayout { | ||
79 | columns: 2; | 67 | columns: 2; | ||
80 | QtControls.CheckBox { | 68 | QtControls.CheckBox { | ||
81 | id: useCustomColorForActiveCheckBox | 69 | id: useCustomColorForActiveCheckBox | ||
82 | text: i18n("Use custom color for active LEDs") | 70 | text: i18n("Use custom color for active LEDs") | ||
83 | } | 71 | } | ||
84 | Rectangle { | 72 | KQuickControls.ColorButton { | ||
85 | width:20 | | |||
86 | height:20 | | |||
87 | id:customColorForActive | 73 | id: customColorForActive | ||
88 | MouseArea { | 74 | enabled: useCustomColorForActiveCheckBox.checked | ||
89 | anchors.fill: parent | | |||
90 | onClicked: { | | |||
91 | colorDialog.element=parent; | | |||
92 | colorDialog.color=parent.color; | | |||
93 | colorDialog.open(); | | |||
94 | } | | |||
95 | } | | |||
96 | } | 75 | } | ||
97 | 76 | | |||
98 | QtControls.CheckBox { | 77 | QtControls.CheckBox { | ||
99 | id: useCustomColorForInactiveCheckBox | 78 | id: useCustomColorForInactiveCheckBox | ||
100 | text: i18n("Use custom color for inactive LEDs") | 79 | text: i18n("Use custom color for inactive LEDs") | ||
101 | } | 80 | } | ||
102 | Rectangle { | 81 | KQuickControls.ColorButton { | ||
103 | width:20 | | |||
104 | height:20 | | |||
105 | id:customColorForInactive | 82 | id:customColorForInactive | ||
106 | MouseArea { | 83 | enabled: useCustomColorForInactiveCheckBox.checked | ||
107 | anchors.fill: parent | | |||
108 | onClicked: { | | |||
109 | colorDialog.element=parent; | | |||
110 | colorDialog.color=parent.color; | | |||
111 | colorDialog.open(); | | |||
112 | } | | |||
113 | } | | |||
114 | } | 84 | } | ||
115 | 85 | | |||
116 | QtControls.CheckBox { | 86 | QtControls.CheckBox { | ||
117 | id: useCustomColorForGridCheckBox | 87 | id: useCustomColorForGridCheckBox | ||
118 | text: i18n("Use custom color for grid") | 88 | text: i18n("Use custom color for grid") | ||
119 | } | 89 | } | ||
120 | Rectangle { | 90 | KQuickControls.ColorButton { | ||
121 | width:20 | | |||
122 | height:20 | | |||
123 | id:customColorForGrid | 91 | id:customColorForGrid | ||
124 | MouseArea { | 92 | enabled: useCustomColorForGridCheckBox.checked | ||
125 | anchors.fill: parent | | |||
126 | onClicked: { | | |||
127 | colorDialog.element=parent; | | |||
128 | colorDialog.color=parent.color; | | |||
129 | colorDialog.open(); | | |||
130 | } | | |||
131 | } | | |||
132 | } | 93 | } | ||
133 | } | 94 | } | ||
134 | } | 95 | } | ||
135 | } | 96 | } |