Commit ac5c3929 authored by Julian Wolff's avatar Julian Wolff
Browse files

fix detecting changes in sub-pixel and hinting settings

Summary:
Since D8916, on changes to the sub-pixel and hinting comboboxes the "apply" button stays disabled.
This patch fixes this, so that one can actually apply changes to the font rendering settings.

Test Plan: Open the fonts kcm and change the sub-pixel or hinting settings. The apply button should be enabled.

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D11174
parent ab4a9153
......@@ -145,6 +145,7 @@ void FontAASettings::load()
xft.getSubPixelType(spType);
setSubPixelCurrentIndex(spType);
m_subPixelCurrentIndexOriginal = spType;
KXftConfig::Hint::Style hStyle;
......@@ -159,6 +160,7 @@ void FontAASettings::load()
}
setHintingCurrentIndex(hStyle);
m_hintingCurrentIndexOriginal = hStyle;
KConfig _cfgfonts("kcmfonts");
KConfigGroup cfgfonts(&_cfgfonts, "General");
......@@ -291,6 +293,9 @@ bool FontAASettings::save(KXftConfig::AntiAliasing::State aaState)
m_excludeToOriginal = m_excludeTo;
m_excludeFromOriginal = m_excludeFrom;
m_subPixelCurrentIndexOriginal = m_subPixelCurrentIndex;
m_hintingCurrentIndexOriginal = m_hintingCurrentIndex;
return mod;
}
......@@ -415,7 +420,12 @@ int FontAASettings::hintingCurrentIndex()
bool FontAASettings::needsSave() const
{
return m_excludeTo != m_excludeToOriginal || m_excludeFrom != m_excludeFromOriginal || m_antiAliasing != m_antiAliasingOriginal || m_dpi != m_dpiOriginal;
return m_excludeTo != m_excludeToOriginal
|| m_excludeFrom != m_excludeFromOriginal
|| m_antiAliasing != m_antiAliasingOriginal
|| m_dpi != m_dpiOriginal
|| m_subPixelCurrentIndex != m_subPixelCurrentIndexOriginal
|| m_hintingCurrentIndex != m_hintingCurrentIndexOriginal;
}
......
......@@ -106,7 +106,9 @@ private:
int m_dpi;
int m_dpiOriginal;
int m_subPixelCurrentIndex = 0;
int m_subPixelCurrentIndexOriginal;
int m_hintingCurrentIndex = 0;
int m_hintingCurrentIndexOriginal;
QStandardItemModel *m_subPixelOptionsModel;
QStandardItemModel *m_hintingOptionsModel;
bool m_exclude = false;
......
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