Changeset View
Changeset View
Standalone View
Standalone View
kcm/package/contents/ui/Panel.qml
Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Line(s) | 78 | Controls.SpinBox { | |||
---|---|---|---|---|---|
86 | to : 3.0 * factor | 86 | to : 3.0 * factor | ||
87 | stepSize: 0.05 * factor | 87 | stepSize: 0.05 * factor | ||
88 | value: kcm.globalScale * factor | 88 | value: kcm.globalScale * factor | ||
89 | validator: DoubleValidator { | 89 | validator: DoubleValidator { | ||
90 | bottom: Math.min(spinbox.from, spinbox.to)*spinbox.factor | 90 | bottom: Math.min(spinbox.from, spinbox.to)*spinbox.factor | ||
91 | top: Math.max(spinbox.from, spinbox.to)*spinbox.factor | 91 | top: Math.max(spinbox.from, spinbox.to)*spinbox.factor | ||
92 | } | 92 | } | ||
93 | textFromValue: function(value, locale) { | 93 | textFromValue: function(value, locale) { | ||
94 | return parseFloat(value * 1.0 / factor).toFixed(2); | 94 | return i18nc("Global scale factor expressed in percentage form", "%1%", parseFloat(value * 1.0 / factor * 100.0)); | ||
95 | } | 95 | } | ||
96 | valueFromText: function(text, locale) { | 96 | valueFromText: function(text, locale) { | ||
97 | return Number.fromLocaleString(locale, text) * factor | 97 | return Number.fromLocaleString(locale, text) * factor / 100.0 | ||
98 | } | 98 | } | ||
99 | onValueModified: { | 99 | onValueModified: { | ||
100 | kcm.globalScale = realValue; | 100 | kcm.globalScale = realValue; | ||
101 | if (kcm.globalScale % 0.25) { | 101 | if (kcm.globalScale % 0.25) { | ||
102 | weirdScaleFactorMsg.visible = true; | 102 | weirdScaleFactorMsg.visible = true; | ||
103 | } else { | 103 | } else { | ||
104 | weirdScaleFactorMsg.visible = false; | 104 | weirdScaleFactorMsg.visible = false; | ||
105 | } | 105 | } | ||
106 | } | 106 | } | ||
107 | } | 107 | } | ||
108 | } | 108 | } | ||
109 | 109 | | |||
110 | Kirigami.InlineMessage { | 110 | Kirigami.InlineMessage { | ||
111 | id: weirdScaleFactorMsg | 111 | id: weirdScaleFactorMsg | ||
112 | Kirigami.FormData.isSection: true | 112 | Kirigami.FormData.isSection: true | ||
113 | Layout.fillWidth: true | 113 | Layout.fillWidth: true | ||
114 | type: Kirigami.MessageType.Warning | 114 | type: Kirigami.MessageType.Warning | ||
115 | text: i18n("Scale factors that are not a multiple of 0.25 may cause visual glitches in applications. Consider setting the scale factor to a multiple of 0.25 and adjusting the font size instead.") | 115 | text: i18n("Scale factors that are not a multiple of 25% may cause visual glitches in applications. Consider setting the scale factor to a multiple of 25% and adjusting the font size instead.") | ||
116 | visible: false | 116 | visible: false | ||
117 | showCloseButton: true | 117 | showCloseButton: true | ||
118 | } | 118 | } | ||
119 | 119 | | |||
120 | Controls.ButtonGroup { | 120 | Controls.ButtonGroup { | ||
121 | buttons: retentionSelector.children | 121 | buttons: retentionSelector.children | ||
122 | } | 122 | } | ||
123 | 123 | | |||
Show All 23 Lines |