Changeset View
Changeset View
Standalone View
Standalone View
kcm/package/contents/ui/Panel.qml
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Line(s) | 67 | Controls.Slider { | |||
---|---|---|---|---|---|
72 | to: 3 | 72 | to: 3 | ||
73 | stepSize: 0.25 | 73 | stepSize: 0.25 | ||
74 | live: true | 74 | live: true | ||
75 | value: kcm.globalScale | 75 | value: kcm.globalScale | ||
76 | onMoved: kcm.globalScale = value; | 76 | onMoved: kcm.globalScale = value; | ||
77 | } | 77 | } | ||
78 | Controls.SpinBox { | 78 | Controls.SpinBox { | ||
79 | id: spinbox | 79 | id: spinbox | ||
80 | Layout.minimumWidth: Kirigami.Units.gridUnit * 6 | ||||
81 | | ||||
80 | // Because QQC2 SpinBox doesn't natively support decimal step | 82 | // Because QQC2 SpinBox doesn't natively support decimal step | ||
81 | // sizes: https://bugreports.qt.io/browse/QTBUG-67349 | 83 | // sizes: https://bugreports.qt.io/browse/QTBUG-67349 | ||
82 | property real factor: 20.0 | 84 | property real factor: 16.0 | ||
83 | property real realValue: value / factor | 85 | property real realValue: value / factor | ||
84 | 86 | | |||
85 | from : 1.0 * factor | 87 | from : 1.0 * factor | ||
86 | to : 3.0 * factor | 88 | to : 3.0 * factor | ||
87 | stepSize: 0.05 * factor | 89 | // On X11 We set the increment to this weird value to compensate | ||
90 | // for inherent difficulties with floating-point math and this | ||||
91 | // Qt bug: https://bugreports.qt.io/browse/QTBUG-66036 | ||||
92 | stepSize: 0.0625 * factor | ||||
88 | value: kcm.globalScale * factor | 93 | value: kcm.globalScale * factor | ||
89 | validator: DoubleValidator { | 94 | validator: DoubleValidator { | ||
90 | bottom: Math.min(spinbox.from, spinbox.to)*spinbox.factor | 95 | bottom: Math.min(spinbox.from, spinbox.to)*spinbox.factor | ||
91 | top: Math.max(spinbox.from, spinbox.to)*spinbox.factor | 96 | top: Math.max(spinbox.from, spinbox.to)*spinbox.factor | ||
92 | } | 97 | } | ||
93 | textFromValue: function(value, locale) { | 98 | textFromValue: function(value, locale) { | ||
94 | return i18nc("Global scale factor expressed in percentage form", "%1%", parseFloat(value * 1.0 / factor * 100.0)); | 99 | return i18nc("Global scale factor expressed in percentage form", "%1%", parseFloat(value * 1.0 / factor * 100.0)); | ||
95 | } | 100 | } | ||
Show All 10 Lines | |||||
106 | } | 111 | } | ||
107 | } | 112 | } | ||
108 | } | 113 | } | ||
109 | 114 | | |||
110 | Kirigami.InlineMessage { | 115 | Kirigami.InlineMessage { | ||
111 | id: weirdScaleFactorMsg | 116 | id: weirdScaleFactorMsg | ||
112 | Kirigami.FormData.isSection: true | 117 | Kirigami.FormData.isSection: true | ||
113 | Layout.fillWidth: true | 118 | Layout.fillWidth: true | ||
114 | type: Kirigami.MessageType.Warning | 119 | type: Kirigami.MessageType.Info | ||
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.") | 120 | text: i18n("Scale factors are limited to multiples of 6.25% to minimize visual glitches in applications.") | ||
116 | visible: false | 121 | visible: false | ||
117 | showCloseButton: true | 122 | showCloseButton: true | ||
118 | } | 123 | } | ||
119 | 124 | | |||
120 | Controls.ButtonGroup { | 125 | Controls.ButtonGroup { | ||
121 | buttons: retentionSelector.children | 126 | buttons: retentionSelector.children | ||
122 | } | 127 | } | ||
123 | 128 | | |||
Show All 23 Lines |