[kcmkwin/kwindesktop] Implement valueFromText in a spinbox

If textFromValue is set, valueFromText must be.

A lot of other implemenetations were using parseInt() which fails at
reading "3,000" due to the comma. Qt's fromLocaleString handles that but
needs any text stripping.

This implementation isn't perfect, but really we need to work on a good
upstream solution.

BUG: 437472
This commit is contained in:
David Edmundson 2021-05-22 10:52:53 +01:00 committed by Nate Graham
parent 27e043920a
commit 5484b846b3

View file

@ -269,6 +269,7 @@ KCM.ScrollViewKCM {
stepSize: 100
textFromValue: function(value, locale) { return i18n("%1 ms", value)}
valueFromText: function(text, locale) {return Number.fromLocaleString(locale, text.split(" ")[0])}
value: kcm.virtualDesktopsSettings.popupHideDelay