Changeset View
Changeset View
Standalone View
Standalone View
kcms/fonts/package/contents/ui/main.qml
Show All 21 Lines | |||||
22 | import QtQuick.Controls 2.0 as QtControls | 22 | import QtQuick.Controls 2.0 as QtControls | ||
23 | import QtQuick.Dialogs 1.2 as QtDialogs | 23 | import QtQuick.Dialogs 1.2 as QtDialogs | ||
24 | import org.kde.kirigami 2.3 as Kirigami | 24 | import org.kde.kirigami 2.3 as Kirigami | ||
25 | import org.kde.kcm 1.1 as KCM | 25 | import org.kde.kcm 1.1 as KCM | ||
26 | 26 | | |||
27 | KCM.SimpleKCM { | 27 | KCM.SimpleKCM { | ||
28 | id: root | 28 | id: root | ||
29 | 29 | | |||
30 | KCM.ConfigModule.quickHelp: i18n("Fonts") | 30 | KCM.ConfigModule.quickHelp: i18n("This module lets you configure the system fonts.") | ||
31 | 31 | | |||
32 | Kirigami.FormLayout { | 32 | Kirigami.FormLayout { | ||
33 | id: formLayout | 33 | id: formLayout | ||
34 | readonly property int maxImplicitWidth: Math.max(adjustAllFontsButton.implicitWidth, Math.max(antiAliasingComboBox.implicitWidth, Math.max(excludeField.implicitWidth, Math.max(subPixelCombo.implicitWidth, hintingCombo.implicitWidth)))) | 34 | readonly property int maxImplicitWidth: Math.max(adjustAllFontsButton.implicitWidth, Math.max(antiAliasingComboBox.implicitWidth, Math.max(excludeField.implicitWidth, Math.max(subPixelCombo.implicitWidth, hintingCombo.implicitWidth)))) | ||
35 | 35 | | |||
36 | QtControls.Button { | 36 | QtControls.Button { | ||
37 | id: adjustAllFontsButton | 37 | id: adjustAllFontsButton | ||
38 | Layout.preferredWidth: formLayout.maxImplicitWidth | 38 | Layout.preferredWidth: formLayout.maxImplicitWidth | ||
39 | icon.name: "font-select-symbolic" | ||||
39 | text: i18n("&Adjust All Fonts...") | 40 | text: i18n("&Adjust All Fonts...") | ||
40 | 41 | | |||
41 | onClicked: kcm.adjustAllFonts(); | 42 | onClicked: kcm.adjustAllFonts(); | ||
42 | } | 43 | } | ||
43 | 44 | | |||
44 | FontWidget { | 45 | FontWidget { | ||
45 | id: generalFontWidget | 46 | id: generalFontWidget | ||
46 | label: i18n("General:") | 47 | label: i18n("General:") | ||
Show All 30 Lines | 77 | Kirigami.Separator { | |||
77 | Kirigami.FormData.isSection: true | 78 | Kirigami.FormData.isSection: true | ||
78 | } | 79 | } | ||
79 | 80 | | |||
80 | QtControls.ComboBox { | 81 | QtControls.ComboBox { | ||
81 | id: antiAliasingComboBox | 82 | id: antiAliasingComboBox | ||
82 | Layout.preferredWidth: formLayout.maxImplicitWidth | 83 | Layout.preferredWidth: formLayout.maxImplicitWidth | ||
83 | Kirigami.FormData.label: i18nc("Used as a noun, and precedes a combobox full of options", "Anti-aliasing:") | 84 | Kirigami.FormData.label: i18nc("Used as a noun, and precedes a combobox full of options", "Anti-aliasing:") | ||
84 | 85 | | |||
85 | model: [i18n("Enabled"), i18n("Vendor Default"), i18n("Disabled")] | 86 | model: [i18n("Enabled"), i18n("Vendor default"), i18n("Disabled")] | ||
86 | 87 | | |||
87 | currentIndex: kcm.fontAASettings.antiAliasing | 88 | currentIndex: kcm.fontAASettings.antiAliasing | ||
88 | onCurrentIndexChanged: kcm.fontAASettings.antiAliasing = antiAliasingComboBox.currentIndex | 89 | onCurrentIndexChanged: kcm.fontAASettings.antiAliasing = antiAliasingComboBox.currentIndex | ||
89 | } | 90 | } | ||
90 | 91 | | |||
91 | QtControls.CheckBox { | 92 | QtControls.CheckBox { | ||
92 | id: excludeCheckBox | 93 | id: excludeCheckBox | ||
93 | checked: kcm.fontAASettings.exclude | 94 | checked: kcm.fontAASettings.exclude | ||
94 | onCheckedChanged: kcm.fontAASettings.exclude = checked; | 95 | onCheckedChanged: kcm.fontAASettings.exclude = checked; | ||
95 | text: i18n("Exclude range from anti-aliasing") | 96 | text: i18n("Exclude range from anti-aliasing") | ||
96 | Layout.fillWidth: true | 97 | Layout.fillWidth: true | ||
97 | enabled: antiAliasingComboBox.currentIndex == 0 | 98 | enabled: antiAliasingComboBox.currentIndex == 0 | ||
98 | } | 99 | } | ||
99 | 100 | | |||
100 | RowLayout { | 101 | RowLayout { | ||
101 | id: excludeField | 102 | id: excludeField | ||
102 | Layout.preferredWidth: formLayout.maxImplicitWidth | | |||
103 | enabled: antiAliasingComboBox.currentIndex == 0 | 103 | enabled: antiAliasingComboBox.currentIndex == 0 | ||
104 | | ||||
105 | Item { | ||||
106 | width: units.largeSpacing | ||||
107 | } | ||||
108 | | ||||
104 | QtControls.SpinBox { | 109 | QtControls.SpinBox { | ||
105 | id: excludeFromSpinBox | 110 | id: excludeFromSpinBox | ||
106 | stepSize: 1 | 111 | stepSize: 1 | ||
107 | onValueChanged: kcm.fontAASettings.excludeFrom = value | 112 | onValueChanged: kcm.fontAASettings.excludeFrom = value | ||
108 | textFromValue: function(value, locale) { return i18n("%1 pt", value)} | 113 | textFromValue: function(value, locale) { return i18n("%1 pt", value)} | ||
109 | enabled: excludeCheckBox.checked | 114 | enabled: excludeCheckBox.checked | ||
110 | } | 115 | } | ||
111 | 116 | | |||
▲ Show 20 Lines • Show All 91 Lines • ▼ Show 20 Line(s) | 185 | delegate: QtControls.ItemDelegate { | |||
203 | } | 208 | } | ||
204 | } | 209 | } | ||
205 | } | 210 | } | ||
206 | 211 | | |||
207 | RowLayout { | 212 | RowLayout { | ||
208 | QtControls.CheckBox { | 213 | QtControls.CheckBox { | ||
209 | id: dpiCheckBox | 214 | id: dpiCheckBox | ||
210 | checked: kcm.fontAASettings.dpi !== 0 | 215 | checked: kcm.fontAASettings.dpi !== 0 | ||
211 | text: i18n("Force Fonts DPI:") | 216 | text: i18n("Force font DPI:") | ||
212 | } | 217 | } | ||
213 | 218 | | |||
214 | QtControls.SpinBox { | 219 | QtControls.SpinBox { | ||
215 | id: dpiSpinBox | 220 | id: dpiSpinBox | ||
216 | stepSize: 24 | 221 | stepSize: 24 | ||
217 | editable: true | 222 | editable: true | ||
218 | enabled: dpiCheckBox.checked | 223 | enabled: dpiCheckBox.checked | ||
219 | value: enabled ? kcm.fontAASettings.dpi : 96 | 224 | value: enabled ? kcm.fontAASettings.dpi : 96 | ||
220 | 225 | | |||
221 | Binding { | 226 | Binding { | ||
222 | target: kcm | 227 | target: kcm | ||
223 | property: "fontAASettings.dpi" | 228 | property: "fontAASettings.dpi" | ||
224 | value: dpiSpinBox.enabled ? dpiSpinBox.value : 0 | 229 | value: dpiSpinBox.enabled ? dpiSpinBox.value : 0 | ||
225 | } | 230 | } | ||
226 | to: 1000 | 231 | to: 1000 | ||
227 | from: 1 | 232 | from: 1 | ||
228 | } | 233 | } | ||
229 | } | 234 | } | ||
230 | 235 | | |||
231 | QtDialogs.FontDialog { | 236 | QtDialogs.FontDialog { | ||
232 | id: fontDialog | 237 | id: fontDialog | ||
233 | title: i18n("Choose a font") | 238 | title: i18n("Select Font") | ||
234 | modality: Qt.WindowModal | 239 | modality: Qt.WindowModal | ||
235 | property string currentCategory | 240 | property string currentCategory | ||
236 | property bool adjustAllFonts: false | 241 | property bool adjustAllFonts: false | ||
237 | onAccepted: { | 242 | onAccepted: { | ||
238 | if (adjustAllFonts) { | 243 | if (adjustAllFonts) { | ||
239 | kcm.adjustAllFonts(font); | 244 | kcm.adjustAllFonts(font); | ||
240 | } else { | 245 | } else { | ||
241 | kcm[currentCategory] = font; | 246 | kcm[currentCategory] = font; | ||
242 | } | 247 | } | ||
243 | } | 248 | } | ||
244 | } | 249 | } | ||
245 | } | 250 | } | ||
246 | } | 251 | } | ||
247 | 252 | |