Changeset View
Changeset View
Standalone View
Standalone View
kcms/nightcolor/package/contents/ui/main.qml
Show All 21 Lines | |||||
22 | import org.kde.kcm 1.2 as KCM | 22 | import org.kde.kcm 1.2 as KCM | ||
23 | 23 | | |||
24 | import org.kde.colorcorrect 0.1 as CC | 24 | import org.kde.colorcorrect 0.1 as CC | ||
25 | 25 | | |||
26 | KCM.SimpleKCM { | 26 | KCM.SimpleKCM { | ||
27 | id: root | 27 | id: root | ||
28 | property int error: cA.error | 28 | property int error: cA.error | ||
29 | property bool defaultRequested: false | 29 | property bool defaultRequested: false | ||
30 | implicitHeight: Kirigami.Units.gridUnit * 29 | 30 | implicitHeight: Kirigami.Units.gridUnit * 32 | ||
31 | implicitWidth: Kirigami.Units.gridUnit * 35 | ||||
31 | 32 | | |||
32 | CC.CompositorAdaptor { | 33 | CC.CompositorAdaptor { | ||
33 | id: cA | 34 | id: cA | ||
34 | } | 35 | } | ||
35 | 36 | | |||
36 | CC.Geolocator { | 37 | CC.Geolocator { | ||
37 | id: locator | 38 | id: locator | ||
38 | } | 39 | } | ||
▲ Show 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 101 | ColumnLayout { | |||
103 | QQC2.Label { | 104 | QQC2.Label { | ||
104 | Layout.topMargin: Kirigami.Units.largeSpacing * 2 | 105 | Layout.topMargin: Kirigami.Units.largeSpacing * 2 | ||
105 | Layout.bottomMargin: Kirigami.Units.largeSpacing * 4 | 106 | Layout.bottomMargin: Kirigami.Units.largeSpacing * 4 | ||
106 | Layout.leftMargin: Kirigami.Units.smallSpacing | 107 | Layout.leftMargin: Kirigami.Units.smallSpacing | ||
107 | Layout.rightMargin: Kirigami.Units.smallSpacing | 108 | Layout.rightMargin: Kirigami.Units.smallSpacing | ||
108 | Layout.alignment: Qt.AlignHCenter | 109 | Layout.alignment: Qt.AlignHCenter | ||
109 | Layout.maximumWidth: Math.round(root.width * 0.5) | 110 | Layout.maximumWidth: Math.round(root.width * 0.5) | ||
110 | 111 | | |||
111 | text: i18n("Night Color makes the colors on the screen warmer to reduce eye strain.") | 112 | text: i18n("To reduce eye strain, Night Color makes the colors on the screen warmer at the time of your choosing.") | ||
112 | wrapMode: Text.WordWrap | 113 | wrapMode: Text.WordWrap | ||
113 | } | 114 | } | ||
114 | 115 | | |||
115 | Kirigami.FormLayout { | 116 | Kirigami.FormLayout { | ||
116 | id: parentLayout | 117 | id: parentLayout | ||
117 | 118 | | |||
118 | QQC2.CheckBox { | 119 | QQC2.CheckBox { | ||
119 | id: activator | 120 | id: activator | ||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | |||||
171 | } | 172 | } | ||
172 | 173 | | |||
173 | Item { | 174 | Item { | ||
174 | Kirigami.FormData.isSection: true | 175 | Kirigami.FormData.isSection: true | ||
175 | } | 176 | } | ||
176 | 177 | | |||
177 | QQC2.ComboBox { | 178 | QQC2.ComboBox { | ||
178 | id: modeSwitcher | 179 | id: modeSwitcher | ||
179 | Kirigami.FormData.label: i18n("Operation mode:") | 180 | // Work around https://bugs.kde.org/show_bug.cgi?id=403153 | ||
181 | Layout.minimumWidth: Kirigami.Units.gridUnit * 17 | ||||
182 | Kirigami.FormData.label: i18n("Activation:") | ||||
180 | enabled: activator.checked | 183 | enabled: activator.checked | ||
181 | model: [ | 184 | model: [ | ||
182 | i18n("Automatic"), | 185 | i18n("Sunset/sunrise (current location)"), | ||
183 | i18n("Location"), | 186 | i18n("Sunset/sunrise (manual location)"), | ||
184 | i18n("Times"), | 187 | i18n("Manual times"), | ||
185 | i18n("Constant") | 188 | i18n("Always on") | ||
186 | ] | 189 | ] | ||
187 | currentIndex: cA.mode | 190 | currentIndex: cA.mode | ||
188 | onCurrentIndexChanged: { | 191 | onCurrentIndexChanged: { | ||
189 | cA.modeStaged = currentIndex; | 192 | cA.modeStaged = currentIndex; | ||
190 | advancedControlLoader.updatePage(currentIndex); | 193 | advancedControlLoader.updatePage(currentIndex); | ||
191 | calcNeedsSave(); | 194 | calcNeedsSave(); | ||
192 | } | 195 | } | ||
193 | } | 196 | } | ||
194 | } | 197 | } | ||
195 | 198 | | |||
199 | Item { | ||||
200 | implicitHeight: Kirigami.Units.gridUnit | ||||
201 | } | ||||
202 | | ||||
196 | Kirigami.FormLayout { | 203 | Kirigami.FormLayout { | ||
197 | 204 | | |||
198 | Loader { | 205 | Loader { | ||
199 | id: advancedControlLoader | 206 | id: advancedControlLoader | ||
200 | 207 | | |||
201 | 208 | | |||
202 | function updatePage(index) { | 209 | function updatePage(index) { | ||
203 | switch (index) { | 210 | switch (index) { | ||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | 295 | Connections { | |||
290 | onReset: { | 297 | onReset: { | ||
291 | mornBeginManField.backend = cA.morningBeginFixed; | 298 | mornBeginManField.backend = cA.morningBeginFixed; | ||
292 | evenBeginManField.backend = cA.eveningBeginFixed; | 299 | evenBeginManField.backend = cA.eveningBeginFixed; | ||
293 | transTimeField.backend = cA.transitionTime; | 300 | transTimeField.backend = cA.transitionTime; | ||
294 | } | 301 | } | ||
295 | } | 302 | } | ||
296 | 303 | | |||
297 | TimeField { | 304 | TimeField { | ||
298 | id: mornBeginManField | 305 | id: evenBeginManField | ||
299 | Kirigami.FormData.label: i18n("Sunrise begins:") | 306 | Kirigami.FormData.label: i18n("Turn on at:") | ||
300 | backend: cA.morningBeginFixedStaged | 307 | backend: cA.eveningBeginFixedStaged | ||
301 | onBackendChanged: {cA.morningBeginFixedStaged = backend; | 308 | onBackendChanged: {cA.eveningBeginFixedStaged = backend; | ||
302 | calcNeedsSave(); | 309 | calcNeedsSave(); | ||
303 | } | 310 | } | ||
304 | 311 | | |||
305 | QQC2.ToolTip { | 312 | QQC2.ToolTip { | ||
306 | text: i18n("(Input format: HH:MM)") | 313 | text: i18n("Input format: HH:MM") | ||
307 | } | 314 | } | ||
308 | } | 315 | } | ||
309 | 316 | | |||
310 | TimeField { | 317 | TimeField { | ||
311 | id: evenBeginManField | 318 | id: mornBeginManField | ||
312 | Kirigami.FormData.label: i18n("Sunset begins:") | 319 | Kirigami.FormData.label: i18n("Turn off at:") | ||
313 | backend: cA.eveningBeginFixedStaged | 320 | backend: cA.morningBeginFixedStaged | ||
314 | onBackendChanged: {cA.eveningBeginFixedStaged = backend; | 321 | onBackendChanged: {cA.morningBeginFixedStaged = backend; | ||
315 | calcNeedsSave(); | 322 | calcNeedsSave(); | ||
316 | } | 323 | } | ||
317 | 324 | | |||
318 | QQC2.ToolTip { | 325 | QQC2.ToolTip { | ||
319 | text: i18n("Input format: HH:MM") | 326 | text: i18n("(Input format: HH:MM)") | ||
320 | } | 327 | } | ||
321 | } | 328 | } | ||
322 | 329 | | |||
323 | QQC2.SpinBox { | 330 | QQC2.SpinBox { | ||
324 | id: transTimeField | 331 | id: transTimeField | ||
325 | // Match width of other text fields | 332 | // Match width of other text fields | ||
326 | Layout.minimumWidth: 200 | 333 | Layout.minimumWidth: 200 | ||
327 | Kirigami.FormData.label: i18n("Transition duration:") | 334 | Kirigami.FormData.label: i18n("Transition duration:") | ||
▲ Show 20 Lines • Show All 49 Lines • Show Last 20 Lines |