Changeset View
Changeset View
Standalone View
Standalone View
kcmkwin/kwinrules/package/contents/ui/RulesEditor.qml
Show First 20 Lines • Show All 204 Lines • ▼ Show 20 Line(s) | 204 | function formatValue(value, type, options) { | |||
---|---|---|---|---|---|
205 | if (value == null) { | 205 | if (value == null) { | ||
206 | return ""; | 206 | return ""; | ||
207 | } | 207 | } | ||
208 | switch (type) { | 208 | switch (type) { | ||
209 | case RuleItem.Boolean: | 209 | case RuleItem.Boolean: | ||
210 | return value ? i18n("Yes") : i18n("No"); | 210 | return value ? i18n("Yes") : i18n("No"); | ||
211 | case RuleItem.Percentage: | 211 | case RuleItem.Percentage: | ||
212 | return i18n("%1 %", value); | 212 | return i18n("%1 %", value); | ||
213 | case RuleItem.Coordinate: | 213 | case RuleItem.Point: | ||
214 | var point = value.split(','); | 214 | return i18nc("Coordinates (x, y)", "(%1, %2)", value.x, value.y); | ||
215 | return i18nc("Coordinates (x, y)", "(%1, %2)", point[0], point[1]); | 215 | case RuleItem.Size: | ||
216 | return i18nc("Size (width, height)", "(%1, %2)", value.width, value.height); | ||||
zzag: The context says "coordinates", but I think it needs to say "size (width, height)". | |||||
yurchor: No objections. | |||||
I didn't want to add a string for 5.19, but since you agree I'll change it, thanks! iasensio: I didn't want to add a string for 5.19, but since you agree I'll change it, thanks! | |||||
216 | case RuleItem.Option: | 217 | case RuleItem.Option: | ||
217 | return options.textOfValue(value); | 218 | return options.textOfValue(value); | ||
218 | case RuleItem.FlagsOption: | 219 | case RuleItem.FlagsOption: | ||
219 | var selectedValue = value.toString(2).length - 1; | 220 | var selectedValue = value.toString(2).length - 1; | ||
220 | return options.textOfValue(selectedValue); | 221 | return options.textOfValue(selectedValue); | ||
221 | } | 222 | } | ||
222 | return value; | 223 | return value; | ||
223 | } | 224 | } | ||
Show All 40 Lines |
The context says "coordinates", but I think it needs to say "size (width, height)".