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

Vlad Zahorodnii noreply at phabricator.kde.org
Mon Oct 21 16:32:31 BST 2019


zzag added inline comments.

INLINE COMMENTS

> main.qml:300
>                                  }
> -
> -                                inputMethodHints: Qt.ImhDigitsOnly
> -                                validator: IntValidator {bottom: 1; top: 600;}  // less than 12 hours (in minutes: 720)
> +                                textFromValue: function(value, locale) {
> +                                    return i18np("%1 minute", "%1 minutes", value)

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

REPOSITORY
  R119 Plasma Desktop

REVISION DETAIL
  https://phabricator.kde.org/D24813

To: ngraham, #vdg, #plasma, davidedmundson
Cc: zzag, davidedmundson, plasma-devel, LeGast00n, The-Feren-OS-Dev, jraleigh, fbampaloukas, GB_2, ragreen, ZrenBot, ngraham, alexeymin, himcesjf, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, apol, ahiemstra, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20191021/ce59e48c/attachment.html>


More information about the Plasma-devel mailing list