Changeset View
Changeset View
Standalone View
Standalone View
kcms/fonts/fontsaasettings.cpp
Show First 20 Lines • Show All 97 Lines • ▼ Show 20 Line(s) | 97 | { | |||
---|---|---|---|---|---|
98 | return m_excludeTo; | 98 | return m_excludeTo; | ||
99 | } | 99 | } | ||
100 | 100 | | |||
101 | void setExcludeTo(int excludeTo) | 101 | void setExcludeTo(int excludeTo) | ||
102 | { | 102 | { | ||
103 | m_excludeTo = excludeTo; | 103 | m_excludeTo = excludeTo; | ||
104 | } | 104 | } | ||
105 | 105 | | |||
106 | bool isImmutable() const | ||||
107 | { | ||||
108 | return m_isImmutable; | ||||
109 | } | ||||
110 | | ||||
106 | bool antiAliasing() const | 111 | bool antiAliasing() const | ||
107 | { | 112 | { | ||
108 | return m_antiAliasing; | 113 | return m_antiAliasing; | ||
109 | } | 114 | } | ||
110 | 115 | | |||
111 | void setAntiAliasing(bool antiAliasing) | 116 | void setAntiAliasing(bool antiAliasing) | ||
112 | { | 117 | { | ||
113 | if (antiAliasing != m_antiAliasing) { | 118 | if (antiAliasing != m_antiAliasing) { | ||
▲ Show 20 Lines • Show All 109 Lines • ▼ Show 20 Line(s) | 202 | { | |||
223 | // if it is not set, we set it to slight hinting | 228 | // if it is not set, we set it to slight hinting | ||
224 | if (hStyle == KXftConfig::Hint::NotSet) { | 229 | if (hStyle == KXftConfig::Hint::NotSet) { | ||
225 | hStyle = KXftConfig::Hint::Slight; | 230 | hStyle = KXftConfig::Hint::Slight; | ||
226 | } | 231 | } | ||
227 | setHinting(hStyle); | 232 | setHinting(hStyle); | ||
228 | 233 | | |||
229 | KSharedConfig::Ptr config = KSharedConfig::openConfig("kdeglobals"); | 234 | KSharedConfig::Ptr config = KSharedConfig::openConfig("kdeglobals"); | ||
230 | KConfigGroup cg(config, "General"); | 235 | KConfigGroup cg(config, "General"); | ||
236 | m_isImmutable = cg.isEntryImmutable("XftAntialias"); | ||||
231 | const auto aaState = xft.getAntiAliasing(); | 237 | const auto aaState = xft.getAntiAliasing(); | ||
232 | setAntiAliasing(aaState != KXftConfig::AntiAliasing::Disabled); | 238 | setAntiAliasing(aaState != KXftConfig::AntiAliasing::Disabled); | ||
233 | 239 | | |||
234 | m_subPixelChanged = false; | 240 | m_subPixelChanged = false; | ||
235 | m_hintingChanged = false; | 241 | m_hintingChanged = false; | ||
236 | m_antiAliasingChanged = false; | 242 | m_antiAliasingChanged = false; | ||
237 | } | 243 | } | ||
238 | 244 | | |||
239 | private: | 245 | private: | ||
240 | FontsAASettings *m_settings; | 246 | FontsAASettings *m_settings; | ||
247 | bool m_isImmutable; | ||||
241 | bool m_antiAliasing; | 248 | bool m_antiAliasing; | ||
242 | bool m_antiAliasingChanged; | 249 | bool m_antiAliasingChanged; | ||
243 | KXftConfig::SubPixel::Type m_subPixel; | 250 | KXftConfig::SubPixel::Type m_subPixel; | ||
244 | bool m_subPixelChanged; | 251 | bool m_subPixelChanged; | ||
245 | KXftConfig::Hint::Style m_hinting; | 252 | KXftConfig::Hint::Style m_hinting; | ||
246 | bool m_hintingChanged; | 253 | bool m_hintingChanged; | ||
247 | bool m_exclude; | 254 | bool m_exclude; | ||
248 | int m_excludeFrom; | 255 | int m_excludeFrom; | ||
▲ Show 20 Lines • Show All 100 Lines • ▼ Show 20 Line(s) | 355 | { | |||
349 | return findItem("hinting")->property().value<KXftConfig::Hint::Style>(); | 356 | return findItem("hinting")->property().value<KXftConfig::Hint::Style>(); | ||
350 | } | 357 | } | ||
351 | 358 | | |||
352 | void FontsAASettings::setHinting(KXftConfig::Hint::Style hinting) | 359 | void FontsAASettings::setHinting(KXftConfig::Hint::Style hinting) | ||
353 | { | 360 | { | ||
354 | findItem("hinting")->setProperty(hinting); | 361 | findItem("hinting")->setProperty(hinting); | ||
355 | } | 362 | } | ||
356 | 363 | | |||
364 | bool FontsAASettings::isImmutable() const | ||||
365 | { | ||||
366 | return m_fontAASettingsStore->isImmutable(); | ||||
367 | } | ||||
368 | | ||||
357 | bool FontsAASettings::usrSave() | 369 | bool FontsAASettings::usrSave() | ||
358 | { | 370 | { | ||
359 | m_fontAASettingsStore->save(); | 371 | m_fontAASettingsStore->save(); | ||
360 | return FontsAASettingsBase::usrSave(); | 372 | return FontsAASettingsBase::usrSave(); | ||
361 | } | 373 | } | ||
362 | 374 | | |||
363 | #include "fontsaasettings.moc" | 375 | #include "fontsaasettings.moc" |