[KCM/Night Color] Use a spinbox with an appropriate suffix for the duration
ClosedPublic

Authored by ngraham on Oct 21 2019, 1:42 AM.

Details

Summary

Currently it's a text box that doesn't give you any indication of what the units are.

BUG:413249
FIXED-IN: 5.18.0

Test Plan

Diff Detail

Repository
R119 Plasma Desktop
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ngraham created this revision.Oct 21 2019, 1:42 AM
Restricted Application added a project: Plasma. · View Herald TranscriptOct 21 2019, 1:42 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
ngraham requested review of this revision.Oct 21 2019, 1:42 AM
davidedmundson requested changes to this revision.Oct 21 2019, 9:11 AM
davidedmundson added a subscriber: davidedmundson.
davidedmundson added inline comments.
kcms/nightcolor/package/contents/ui/main.qml
305

where has this gone?

316

i18np

This revision now requires changes to proceed.Oct 21 2019, 9:11 AM
davidedmundson added inline comments.Oct 21 2019, 9:21 AM
kcms/nightcolor/package/contents/ui/main.qml
305

Edit. ignore this.

ngraham updated this revision to Diff 68434.Oct 21 2019, 1:41 PM
ngraham marked 2 inline comments as done.

Handle singular and plural forms of the word

davidedmundson accepted this revision.Oct 21 2019, 1:42 PM
This revision is now accepted and ready to land.Oct 21 2019, 1:42 PM
This revision was automatically updated to reflect the committed changes.
zzag added a subscriber: zzag.Oct 21 2019, 3:32 PM
zzag added inline comments.
kcms/nightcolor/package/contents/ui/main.qml
315–317

Qt documentation says that we need to override valueFromText

Note: When applying a custom textFromValue implementation for editable spinboxes, a matching valueFromText implementation must be provided to be able to convert the custom text back to an integer value.

https://doc.qt.io/qt-5/qml-qtquick-controls2-spinbox.html#valueFromText-prop

ngraham added inline comments.Oct 21 2019, 3:34 PM
kcms/nightcolor/package/contents/ui/main.qml
315–317

Ah ok, will add that in a follow-up patch.