Changeset View
Changeset View
Standalone View
Standalone View
kcms/fonts/package/contents/ui/main.qml
Show First 20 Lines • Show All 106 Lines • ▼ Show 20 Line(s) | 47 | Kirigami.FormLayout { | |||
---|---|---|---|---|---|
107 | 107 | | |||
108 | QtControls.CheckBox { | 108 | QtControls.CheckBox { | ||
109 | id: antiAliasingCheckBox | 109 | id: antiAliasingCheckBox | ||
110 | checked: kcm.fontsAASettings.antiAliasing | 110 | checked: kcm.fontsAASettings.antiAliasing | ||
111 | onCheckedChanged: kcm.fontsAASettings.antiAliasing = checked | 111 | onCheckedChanged: kcm.fontsAASettings.antiAliasing = checked | ||
112 | Kirigami.FormData.label: i18n("Anti-Aliasing:") | 112 | Kirigami.FormData.label: i18n("Anti-Aliasing:") | ||
113 | text: i18n("Enable") | 113 | text: i18n("Enable") | ||
114 | Layout.fillWidth: true | 114 | Layout.fillWidth: true | ||
115 | enabled: !kcm.fontsAASettings.isImmutable | ||||
115 | } | 116 | } | ||
116 | 117 | | |||
117 | QtControls.CheckBox { | 118 | QtControls.CheckBox { | ||
118 | id: excludeCheckBox | 119 | id: excludeCheckBox | ||
119 | checked: kcm.fontsAASettings.exclude | 120 | checked: kcm.fontsAASettings.exclude | ||
120 | onCheckedChanged: kcm.fontsAASettings.exclude = checked; | 121 | onCheckedChanged: kcm.fontsAASettings.exclude = checked; | ||
121 | text: i18n("Exclude range from anti-aliasing") | 122 | text: i18n("Exclude range from anti-aliasing") | ||
122 | Layout.fillWidth: true | 123 | Layout.fillWidth: true | ||
123 | enabled: antiAliasingCheckBox.checked | 124 | enabled: antiAliasingCheckBox.checked && !kcm.fontsAASettings.isImmutable | ||
124 | } | 125 | } | ||
125 | 126 | | |||
126 | RowLayout { | 127 | RowLayout { | ||
127 | id: excludeField | 128 | id: excludeField | ||
128 | Layout.preferredWidth: formLayout.maxImplicitWidth | 129 | Layout.preferredWidth: formLayout.maxImplicitWidth | ||
129 | enabled: antiAliasingCheckBox.checked | 130 | enabled: antiAliasingCheckBox.checked && !kcm.fontsAASettings.isImmutable | ||
130 | QtControls.SpinBox { | 131 | QtControls.SpinBox { | ||
131 | id: excludeFromSpinBox | 132 | id: excludeFromSpinBox | ||
132 | stepSize: 1 | 133 | stepSize: 1 | ||
133 | onValueChanged: kcm.fontsAASettings.excludeFrom = value | 134 | onValueChanged: kcm.fontsAASettings.excludeFrom = value | ||
134 | textFromValue: function(value, locale) { return i18n("%1 pt", value)} | 135 | textFromValue: function(value, locale) { return i18n("%1 pt", value)} | ||
135 | valueFromText: function(text, locale) { return parseInt(text) } | 136 | valueFromText: function(text, locale) { return parseInt(text) } | ||
136 | editable: true | 137 | editable: true | ||
137 | enabled: excludeCheckBox.checked | 138 | enabled: excludeCheckBox.checked | ||
138 | value: kcm.fontsAASettings.excludeFrom | 139 | value: kcm.fontsAASettings.excludeFrom | ||
139 | } | 140 | } | ||
140 | 141 | | |||
141 | QtControls.Label { | 142 | QtControls.Label { | ||
142 | Layout.fillWidth: true | 143 | Layout.fillWidth: true | ||
143 | horizontalAlignment: Text.AlignHCenter | 144 | horizontalAlignment: Text.AlignHCenter | ||
144 | text: i18n("to") | 145 | text: i18n("to") | ||
145 | enabled: excludeCheckBox.checked | 146 | enabled: excludeCheckBox.checked && !kcm.fontsAASettings.isImmutable | ||
146 | } | 147 | } | ||
147 | 148 | | |||
148 | QtControls.SpinBox { | 149 | QtControls.SpinBox { | ||
149 | id: excludeToSpinBox | 150 | id: excludeToSpinBox | ||
150 | stepSize: 1 | 151 | stepSize: 1 | ||
151 | onValueChanged: kcm.fontsAASettings.excludeTo = value | 152 | onValueChanged: kcm.fontsAASettings.excludeTo = value | ||
152 | textFromValue: function(value, locale) { return i18n("%1 pt", value)} | 153 | textFromValue: function(value, locale) { return i18n("%1 pt", value)} | ||
153 | valueFromText: function(text, locale) { return parseInt(text) } | 154 | valueFromText: function(text, locale) { return parseInt(text) } | ||
154 | editable: true | 155 | editable: true | ||
155 | enabled: excludeCheckBox.checked | 156 | enabled: excludeCheckBox.checked && !kcm.fontsAASettings.isImmutable | ||
156 | value: kcm.fontsAASettings.excludeTo | 157 | value: kcm.fontsAASettings.excludeTo | ||
157 | } | 158 | } | ||
158 | Connections { | 159 | Connections { | ||
159 | target: kcm.fontsAASettings | 160 | target: kcm.fontsAASettings | ||
160 | onExcludeFromChanged: excludeFromSpinBox.value = kcm.fontsAASettings.excludeFrom; | 161 | onExcludeFromChanged: excludeFromSpinBox.value = kcm.fontsAASettings.excludeFrom; | ||
161 | onExcludeToChanged: excludeToSpinBox.value = kcm.fontsAASettings.excludeTo; | 162 | onExcludeToChanged: excludeToSpinBox.value = kcm.fontsAASettings.excludeTo; | ||
162 | } | 163 | } | ||
163 | } | 164 | } | ||
164 | 165 | | |||
165 | QtControls.ComboBox { | 166 | QtControls.ComboBox { | ||
166 | id: subPixelCombo | 167 | id: subPixelCombo | ||
167 | Layout.preferredWidth: formLayout.maxImplicitWidth | 168 | Layout.preferredWidth: formLayout.maxImplicitWidth | ||
168 | Kirigami.FormData.label: i18nc("Used as a noun, and precedes a combobox full of options", "Sub-pixel rendering:") | 169 | Kirigami.FormData.label: i18nc("Used as a noun, and precedes a combobox full of options", "Sub-pixel rendering:") | ||
169 | currentIndex: kcm.subPixelCurrentIndex | 170 | currentIndex: kcm.subPixelCurrentIndex | ||
170 | onCurrentIndexChanged: kcm.subPixelCurrentIndex = currentIndex; | 171 | onCurrentIndexChanged: kcm.subPixelCurrentIndex = currentIndex; | ||
171 | model: kcm.subPixelOptionsModel | 172 | model: kcm.subPixelOptionsModel | ||
172 | textRole: "display" | 173 | textRole: "display" | ||
173 | enabled: antiAliasingCheckBox.checked | 174 | enabled: antiAliasingCheckBox.checked && !kcm.fontsAASettings.isImmutable | ||
174 | popup.height: popup.implicitHeight | 175 | popup.height: popup.implicitHeight | ||
175 | delegate: QtControls.ItemDelegate { | 176 | delegate: QtControls.ItemDelegate { | ||
176 | id: subPixelDelegate | 177 | id: subPixelDelegate | ||
177 | onWidthChanged: { | 178 | onWidthChanged: { | ||
178 | subPixelCombo.popup.width = Math.max(subPixelCombo.popup.width, width) | 179 | subPixelCombo.popup.width = Math.max(subPixelCombo.popup.width, width) | ||
179 | } | 180 | } | ||
180 | contentItem: ColumnLayout { | 181 | contentItem: ColumnLayout { | ||
181 | id: subPixelLayout | 182 | id: subPixelLayout | ||
Show All 20 Lines | |||||
202 | QtControls.ComboBox { | 203 | QtControls.ComboBox { | ||
203 | id: hintingCombo | 204 | id: hintingCombo | ||
204 | Layout.preferredWidth: formLayout.maxImplicitWidth | 205 | Layout.preferredWidth: formLayout.maxImplicitWidth | ||
205 | Kirigami.FormData.label: i18nc("Used as a noun, and precedes a combobox full of options", "Hinting:") | 206 | Kirigami.FormData.label: i18nc("Used as a noun, and precedes a combobox full of options", "Hinting:") | ||
206 | currentIndex: kcm.hintingCurrentIndex | 207 | currentIndex: kcm.hintingCurrentIndex | ||
207 | onCurrentTextChanged: kcm.hintingCurrentIndex = currentIndex; | 208 | onCurrentTextChanged: kcm.hintingCurrentIndex = currentIndex; | ||
208 | model: kcm.hintingOptionsModel | 209 | model: kcm.hintingOptionsModel | ||
209 | textRole: "display" | 210 | textRole: "display" | ||
210 | enabled: antiAliasingCheckBox.checked | 211 | enabled: antiAliasingCheckBox.checked && !kcm.fontsAASettings.isImmutable | ||
211 | popup.height: popup.implicitHeight | 212 | popup.height: popup.implicitHeight | ||
212 | delegate: QtControls.ItemDelegate { | 213 | delegate: QtControls.ItemDelegate { | ||
213 | id: hintingDelegate | 214 | id: hintingDelegate | ||
214 | onWidthChanged: { | 215 | onWidthChanged: { | ||
215 | hintingCombo.popup.width = Math.max(hintingCombo.popup.width, width) | 216 | hintingCombo.popup.width = Math.max(hintingCombo.popup.width, width) | ||
216 | } | 217 | } | ||
217 | contentItem: ColumnLayout { | 218 | contentItem: ColumnLayout { | ||
218 | id: hintingLayout | 219 | id: hintingLayout | ||
Show All 15 Lines | |||||
234 | } | 235 | } | ||
235 | } | 236 | } | ||
236 | } | 237 | } | ||
237 | } | 238 | } | ||
238 | 239 | | |||
239 | RowLayout { | 240 | RowLayout { | ||
240 | QtControls.CheckBox { | 241 | QtControls.CheckBox { | ||
241 | id: dpiCheckBox | 242 | id: dpiCheckBox | ||
243 | enabled: !kcm.fontsAASettings.isImmutable | ||||
242 | checked: kcm.fontsAASettings.dpi !== 0 | 244 | checked: kcm.fontsAASettings.dpi !== 0 | ||
243 | text: i18n("Force font DPI:") | 245 | text: i18n("Force font DPI:") | ||
244 | onClicked: kcm.fontsAASettings.dpi = (checked ? dpiSpinBox.value : 0) | 246 | onClicked: kcm.fontsAASettings.dpi = (checked ? dpiSpinBox.value : 0) | ||
245 | } | 247 | } | ||
246 | 248 | | |||
247 | QtControls.SpinBox { | 249 | QtControls.SpinBox { | ||
248 | id: dpiSpinBox | 250 | id: dpiSpinBox | ||
249 | stepSize: 24 | 251 | stepSize: 24 | ||
250 | editable: true | 252 | editable: true | ||
251 | enabled: dpiCheckBox.checked | 253 | enabled: dpiCheckBox.checked && !kcm.fontsAASettings.isImmutable | ||
252 | value: kcm.fontsAASettings.dpi !== 0 ? kcm.fontsAASettings.dpi : 96 | 254 | value: kcm.fontsAASettings.dpi !== 0 ? kcm.fontsAASettings.dpi : 96 | ||
253 | onValueModified: kcm.fontsAASettings.dpi = value | 255 | onValueModified: kcm.fontsAASettings.dpi = value | ||
254 | // to: need to divide to stepSize | 256 | // to: need to divide to stepSize | ||
255 | to: 1008 | 257 | to: 1008 | ||
256 | // lowest vaue here can be == stepSize, that is because 0 means off | 258 | // lowest vaue here can be == stepSize, that is because 0 means off | ||
257 | from: 24 | 259 | from: 24 | ||
258 | } | 260 | } | ||
259 | } | 261 | } | ||
Show All 18 Lines |