Commit b2694cfc authored by David Edmundson's avatar David Edmundson
Browse files

Fix Font KCM force font DPI checkbox

Summary:
Fixes numerous issues:

1) the default behaviour had changed. It should disable force font DPI,
not set it to 96
2) disabling didn't work, we'd set the value to 0, which would update
the spinbox, which has a minimum which sets the value to 96 (we were
warned of this with a binding loop error)
3) toggling the checkbox didn't enable the apply button

New code fixes that and is more declarative too.

BUG: 394180

Test Plan: Toggled, reset to defaults, restarted

Reviewers: #plasma, progwolff, broulik

Reviewed By: #plasma, progwolff, broulik

Subscribers: broulik, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D13051
parent 2ba367d5
......@@ -307,7 +307,7 @@ void FontAASettings::defaults()
setExcludeFrom(8);
setAntiAliasing(1);
m_antiAliasingOriginal = m_antiAliasing;
setDpi(96);
setDpi(0);
setSubPixelCurrentIndex(KXftConfig::SubPixel::NotSet);
setHintingCurrentIndex(KXftConfig::Hint::NotSet);
}
......
......@@ -206,16 +206,8 @@ KCM.SimpleKCM {
RowLayout {
QtControls.CheckBox {
id: dpiCheckBox
checked: dpiSpinBox.value != 96
checked: kcm.fontAASettings.dpi != 0
text: i18n("Force Fonts DPI:")
onCheckedChanged: {
if (!dpiCheckBox.checked) {
dpiSpinBox.enabled = false;
kcm.fontAASettings.dpi = 0;
} else {
dpiSpinBox.enabled = true;
}
}
}
QtControls.SpinBox {
......@@ -224,7 +216,12 @@ KCM.SimpleKCM {
editable: true
enabled: dpiCheckBox.checked
value: kcm.fontAASettings.dpi
onValueChanged: kcm.fontAASettings.dpi = dpiSpinBox.value
Binding {
target: kcm
property: "fontAASettings.dpi"
value: dpiSpinBox.enabled ? dpiSpinBox.value : 0
}
to: 1000
from: 96
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment