Changeset View
Changeset View
Standalone View
Standalone View
kcms/fonts/package/contents/ui/main.qml
| Show All 25 Lines | |||||
| 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("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, excludeField.implicitWidth, 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 | text: i18n("&Adjust All Fonts...") | 39 | text: i18n("&Adjust All Fonts...") | ||
| 40 | 40 | | |||
| 41 | onClicked: kcm.adjustAllFonts(); | 41 | onClicked: kcm.adjustAllFonts(); | ||
| 42 | } | 42 | } | ||
| Show All 29 Lines | 70 | FontWidget { | |||
| 72 | category: "windowTitleFont" | 72 | category: "windowTitleFont" | ||
| 73 | font: kcm.windowTitleFont | 73 | font: kcm.windowTitleFont | ||
| 74 | } | 74 | } | ||
| 75 | 75 | | |||
| 76 | Kirigami.Separator { | 76 | Kirigami.Separator { | ||
| 77 | Kirigami.FormData.isSection: true | 77 | Kirigami.FormData.isSection: true | ||
| 78 | } | 78 | } | ||
| 79 | 79 | | |||
| 80 | QtControls.ComboBox { | 80 | QtControls.CheckBox { | ||
| 81 | id: antiAliasingComboBox | 81 | id: antiAliasingCheckBox | ||
| 82 | Layout.preferredWidth: formLayout.maxImplicitWidth | 82 | checked: kcm.fontAASettings.antiAliasing | ||
| 83 | Kirigami.FormData.label: i18n("Use anti-aliasing:") | 83 | onCheckedChanged: kcm.fontAASettings.antiAliasing = checked | ||
| 84 | 84 | Kirigami.FormData.label: i18n("Anti-Aliasing:") | |||
| 85 | model: [i18n("Enabled"), i18n("Vendor Default"), i18n("Disabled")] | 85 | text: i18n("Enable") | ||
| 86 | 86 | Layout.fillWidth: true | |||
| 87 | currentIndex: kcm.fontAASettings.antiAliasing | | |||
| 88 | onCurrentIndexChanged: kcm.fontAASettings.antiAliasing = antiAliasingComboBox.currentIndex | | |||
| 89 | } | 87 | } | ||
| 90 | 88 | | |||
| 91 | QtControls.CheckBox { | 89 | QtControls.CheckBox { | ||
| 92 | id: excludeCheckBox | 90 | id: excludeCheckBox | ||
| 93 | checked: kcm.fontAASettings.exclude | 91 | checked: kcm.fontAASettings.exclude | ||
| 94 | onCheckedChanged: kcm.fontAASettings.exclude = checked; | 92 | onCheckedChanged: kcm.fontAASettings.exclude = checked; | ||
| 95 | text: i18n("Exclude range from anti-aliasing") | 93 | text: i18n("Exclude range from anti-aliasing") | ||
| 96 | Layout.fillWidth: true | 94 | Layout.fillWidth: true | ||
| 97 | enabled: antiAliasingComboBox.currentIndex == 0 | 95 | enabled: antiAliasingCheckBox.checked | ||
| 98 | } | 96 | } | ||
| 99 | 97 | | |||
| 100 | RowLayout { | 98 | RowLayout { | ||
| 101 | id: excludeField | 99 | id: excludeField | ||
| 102 | Layout.preferredWidth: formLayout.maxImplicitWidth | 100 | Layout.preferredWidth: formLayout.maxImplicitWidth | ||
| 103 | enabled: antiAliasingComboBox.currentIndex == 0 | 101 | enabled: antiAliasingCheckBox.checked | ||
| 104 | QtControls.SpinBox { | 102 | QtControls.SpinBox { | ||
| 105 | id: excludeFromSpinBox | 103 | id: excludeFromSpinBox | ||
| 106 | stepSize: 1 | 104 | stepSize: 1 | ||
| 107 | onValueChanged: kcm.fontAASettings.excludeFrom = value | 105 | onValueChanged: kcm.fontAASettings.excludeFrom = value | ||
| 108 | textFromValue: function(value, locale) { return i18n("%1 pt", value)} | 106 | textFromValue: function(value, locale) { return i18n("%1 pt", value)} | ||
| 109 | enabled: excludeCheckBox.checked | 107 | enabled: excludeCheckBox.checked | ||
| 110 | } | 108 | } | ||
| 111 | 109 | | |||
| Show All 21 Lines | |||||
| 133 | QtControls.ComboBox { | 131 | QtControls.ComboBox { | ||
| 134 | id: subPixelCombo | 132 | id: subPixelCombo | ||
| 135 | Layout.preferredWidth: formLayout.maxImplicitWidth | 133 | Layout.preferredWidth: formLayout.maxImplicitWidth | ||
| 136 | Kirigami.FormData.label: i18n("Sub-pixel rendering type:") | 134 | Kirigami.FormData.label: i18n("Sub-pixel rendering type:") | ||
| 137 | currentIndex: kcm.fontAASettings.subPixelCurrentIndex | 135 | currentIndex: kcm.fontAASettings.subPixelCurrentIndex | ||
| 138 | onCurrentIndexChanged: kcm.fontAASettings.subPixelCurrentIndex = currentIndex; | 136 | onCurrentIndexChanged: kcm.fontAASettings.subPixelCurrentIndex = currentIndex; | ||
| 139 | model: kcm.fontAASettings.subPixelOptionsModel | 137 | model: kcm.fontAASettings.subPixelOptionsModel | ||
| 140 | textRole: "display" | 138 | textRole: "display" | ||
| 141 | enabled: antiAliasingComboBox.currentIndex == 0 | 139 | enabled: antiAliasingCheckBox.checked | ||
| 142 | popup.height: popup.implicitHeight | 140 | popup.height: popup.implicitHeight | ||
| 143 | delegate: QtControls.ItemDelegate { | 141 | delegate: QtControls.ItemDelegate { | ||
| 144 | id: subPixelDelegate | 142 | id: subPixelDelegate | ||
| 145 | onWidthChanged: { | 143 | onWidthChanged: { | ||
| 146 | subPixelCombo.popup.width = Math.max(subPixelCombo.popup.width, width) | 144 | subPixelCombo.popup.width = Math.max(subPixelCombo.popup.width, width) | ||
| 147 | } | 145 | } | ||
| 148 | contentItem: ColumnLayout { | 146 | contentItem: ColumnLayout { | ||
| 149 | id: subPixelLayout | 147 | id: subPixelLayout | ||
| Show All 20 Lines | |||||
| 170 | QtControls.ComboBox { | 168 | QtControls.ComboBox { | ||
| 171 | id: hintingCombo | 169 | id: hintingCombo | ||
| 172 | Layout.preferredWidth: formLayout.maxImplicitWidth | 170 | Layout.preferredWidth: formLayout.maxImplicitWidth | ||
| 173 | Kirigami.FormData.label: i18n("Hinting style:") | 171 | Kirigami.FormData.label: i18n("Hinting style:") | ||
| 174 | currentIndex: kcm.fontAASettings.hintingCurrentIndex | 172 | currentIndex: kcm.fontAASettings.hintingCurrentIndex | ||
| 175 | onCurrentTextChanged: kcm.fontAASettings.hintingCurrentIndex = currentIndex; | 173 | onCurrentTextChanged: kcm.fontAASettings.hintingCurrentIndex = currentIndex; | ||
| 176 | model: kcm.fontAASettings.hintingOptionsModel | 174 | model: kcm.fontAASettings.hintingOptionsModel | ||
| 177 | textRole: "display" | 175 | textRole: "display" | ||
| 178 | enabled: antiAliasingComboBox.currentIndex == 0 | 176 | enabled: antiAliasingCheckBox.checked | ||
| 179 | popup.height: popup.implicitHeight | 177 | popup.height: popup.implicitHeight | ||
| 180 | delegate: QtControls.ItemDelegate { | 178 | delegate: QtControls.ItemDelegate { | ||
| 181 | id: hintingDelegate | 179 | id: hintingDelegate | ||
| 182 | onWidthChanged: { | 180 | onWidthChanged: { | ||
| 183 | hintingCombo.popup.width = Math.max(hintingCombo.popup.width, width) | 181 | hintingCombo.popup.width = Math.max(hintingCombo.popup.width, width) | ||
| 184 | } | 182 | } | ||
| 185 | contentItem: ColumnLayout { | 183 | contentItem: ColumnLayout { | ||
| 186 | id: hintingLayout | 184 | id: hintingLayout | ||
| ▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines | |||||