[kcmkwin/kwindesktop] Fix inability to create more than one row on the "Virtual Desktops" settings page

Summary:
When a spinbox with the number of rows loses focus, the value of this spinbox (i.e., the count of rows) is always reset to 1. Thus, it's impossible to create more then one row.

To fix this bug, we need to implement `valueFromText` function.

BUG: 419141
FIXED-IN: 5.18.4

Reviewers: ngraham, zzag, davidedmundson

Reviewed By: ngraham, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D28378
This commit is contained in:
Eugene Popov 2020-03-29 18:13:55 -06:00 committed by Nate Graham
parent f18109d9c4
commit ae022e92c9

View file

@ -159,6 +159,7 @@ ScrollViewKCM {
editable: true
textFromValue: function(value, locale) { return i18np("1 Row", "%1 Rows", value)}
valueFromText: function(text, locale) { return parseInt(text, 10); }
onValueModified: kcm.desktopsModel.rows = value
}