Changeset View
Changeset View
Standalone View
Standalone View
kcms/fonts/fonts.cpp
Show First 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | |||||
49 | #include <KFontDialog> | 49 | #include <KFontDialog> | ||
50 | #include <KAcceleratorManager> | 50 | #include <KAcceleratorManager> | ||
51 | #include <KGlobalSettings> | 51 | #include <KGlobalSettings> | ||
52 | #include <KMessageBox> | 52 | #include <KMessageBox> | ||
53 | #include <KConfig> | 53 | #include <KConfig> | ||
54 | #include <KConfigGroup> | 54 | #include <KConfigGroup> | ||
55 | #include <KLocalizedString> | 55 | #include <KLocalizedString> | ||
56 | #include <KPluginFactory> | 56 | #include <KPluginFactory> | ||
57 | #include <KWindowSystem> | ||||
57 | 58 | | |||
58 | #include "../krdb/krdb.h" | 59 | #include "../krdb/krdb.h" | ||
59 | 60 | | |||
60 | #ifdef HAVE_FREETYPE | 61 | #ifdef HAVE_FREETYPE | ||
61 | #include <ft2build.h> | 62 | #include <ft2build.h> | ||
62 | #ifdef FT_LCD_FILTER_H | 63 | #ifdef FT_LCD_FILTER_H | ||
63 | #include FT_FREETYPE_H | 64 | #include FT_FREETYPE_H | ||
64 | #include FT_LCD_FILTER_H | 65 | #include FT_LCD_FILTER_H | ||
▲ Show 20 Lines • Show All 672 Lines • ▼ Show 20 Line(s) | |||||
737 | 738 | | |||
738 | #if defined(HAVE_FONTCONFIG) && defined (HAVE_X11) | 739 | #if defined(HAVE_FONTCONFIG) && defined (HAVE_X11) | ||
739 | useAA_original = useAA = aaSettings->load() ? AAEnabled : AADisabled; | 740 | useAA_original = useAA = aaSettings->load() ? AAEnabled : AADisabled; | ||
740 | cbAA->setCurrentIndex(useAA); | 741 | cbAA->setCurrentIndex(useAA); | ||
741 | #endif | 742 | #endif | ||
742 | 743 | | |||
743 | KConfig _cfgfonts("kcmfonts"); | 744 | KConfig _cfgfonts("kcmfonts"); | ||
744 | KConfigGroup cfgfonts(&_cfgfonts, "General"); | 745 | KConfigGroup cfgfonts(&_cfgfonts, "General"); | ||
745 | int dpicfg = cfgfonts.readEntry("forceFontDPI", 0); | 746 | int dpicfg; | ||
747 | if (KWindowSystem::isPlatformWayland()) { | ||||
748 | dpicfg = cfgfonts.readEntry("forceFontDPIWayland", 0); | ||||
749 | } else { | ||||
750 | dpicfg = cfgfonts.readEntry("forceFontDPI", 0); | ||||
751 | } | ||||
752 | | ||||
746 | if (dpicfg <= 0) { | 753 | if (dpicfg <= 0) { | ||
747 | checkboxForceDpi->setChecked(false); | 754 | checkboxForceDpi->setChecked(false); | ||
748 | spinboxDpi->setValue(96); | 755 | spinboxDpi->setValue(96); | ||
749 | dpi_original = 0; | 756 | dpi_original = 0; | ||
750 | } else { | 757 | } else { | ||
751 | checkboxForceDpi->setChecked(true); | 758 | checkboxForceDpi->setChecked(true); | ||
752 | spinboxDpi->setValue(dpicfg); | 759 | spinboxDpi->setValue(dpicfg); | ||
753 | dpi_original = dpicfg; | 760 | dpi_original = dpicfg; | ||
Show All 17 Lines | 777 | for (; it != end; ++it) { | |||
771 | (*it)->writeFont(); | 778 | (*it)->writeFont(); | ||
772 | } | 779 | } | ||
773 | 780 | | |||
774 | KSharedConfig::openConfig()->sync(); | 781 | KSharedConfig::openConfig()->sync(); | ||
775 | 782 | | |||
776 | KConfig _cfgfonts("kcmfonts"); | 783 | KConfig _cfgfonts("kcmfonts"); | ||
777 | KConfigGroup cfgfonts(&_cfgfonts, "General"); | 784 | KConfigGroup cfgfonts(&_cfgfonts, "General"); | ||
778 | int dpi = (checkboxForceDpi->isChecked() ? spinboxDpi->value() : 0); | 785 | int dpi = (checkboxForceDpi->isChecked() ? spinboxDpi->value() : 0); | ||
786 | if (KWindowSystem::isPlatformWayland()) { | ||||
787 | cfgfonts.writeEntry("forceFontDPIWayland", dpi); | ||||
788 | } else { | ||||
779 | cfgfonts.writeEntry("forceFontDPI", dpi); | 789 | cfgfonts.writeEntry("forceFontDPI", dpi); | ||
790 | } | ||||
780 | #if defined(HAVE_FONTCONFIG) && defined (HAVE_X11) | 791 | #if defined(HAVE_FONTCONFIG) && defined (HAVE_X11) | ||
781 | cfgfonts.writeEntry("dontChangeAASettings", cbAA->currentIndex() == AASystem); | 792 | cfgfonts.writeEntry("dontChangeAASettings", cbAA->currentIndex() == AASystem); | ||
782 | #endif | 793 | #endif | ||
783 | cfgfonts.sync(); | 794 | cfgfonts.sync(); | ||
784 | #if HAVE_X11 | 795 | #if HAVE_X11 | ||
785 | // if the setting is reset in the module, remove the dpi value, | 796 | // if the setting is reset in the module, remove the dpi value, | ||
786 | // otherwise don't explicitly remove it and leave any possible system-wide value | 797 | // otherwise don't explicitly remove it and leave any possible system-wide value | ||
787 | if (dpi == 0 && dpi_original != 0) { | 798 | if (dpi == 0 && dpi_original != 0) { | ||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |