Changeset View
Changeset View
Standalone View
Standalone View
kcms/fonts/fonts.cpp
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
42 | #include <KAboutData> | 42 | #include <KAboutData> | ||
43 | #include <KLocalizedString> | 43 | #include <KLocalizedString> | ||
44 | #include <KPluginFactory> | 44 | #include <KPluginFactory> | ||
45 | #include <KFontDialog> | 45 | #include <KFontDialog> | ||
46 | #include <KWindowSystem> | 46 | #include <KWindowSystem> | ||
47 | #include <KMessageBox> | 47 | #include <KMessageBox> | ||
48 | 48 | | |||
49 | #include "../krdb/krdb.h" | 49 | #include "../krdb/krdb.h" | ||
50 | #include "previewimageprovider.h" | ||||
50 | 51 | | |||
51 | /**** DLL Interface ****/ | 52 | /**** DLL Interface ****/ | ||
52 | K_PLUGIN_FACTORY_WITH_JSON(KFontsFactory, "kcm_fonts.json", registerPlugin<KFonts>();) | 53 | K_PLUGIN_FACTORY_WITH_JSON(KFontsFactory, "kcm_fonts.json", registerPlugin<KFonts>();) | ||
53 | 54 | | |||
54 | //from KFontRequester | 55 | //from KFontRequester | ||
55 | // Determine if the font with given properties is available on the system, | 56 | // Determine if the font with given properties is available on the system, | ||
56 | // otherwise find and return the best fitting combination. | 57 | // otherwise find and return the best fitting combination. | ||
57 | static QFont nearestExistingFont(const QFont &font) | 58 | static QFont nearestExistingFont(const QFont &font) | ||
▲ Show 20 Lines • Show All 426 Lines • ▼ Show 20 Line(s) | 475 | { | |||
484 | 485 | | |||
485 | m_toolbarFont = m_toolbarFontOriginal = nearestExistingFont(cg.readEntry("toolBarFont", m_defaultFont)); | 486 | m_toolbarFont = m_toolbarFontOriginal = nearestExistingFont(cg.readEntry("toolBarFont", m_defaultFont)); | ||
486 | 487 | | |||
487 | m_menuFont = m_menuFontOriginal = nearestExistingFont(cg.readEntry("menuFont", m_defaultFont)); | 488 | m_menuFont = m_menuFontOriginal = nearestExistingFont(cg.readEntry("menuFont", m_defaultFont)); | ||
488 | 489 | | |||
489 | cg = KConfigGroup(config, "WM"); | 490 | cg = KConfigGroup(config, "WM"); | ||
490 | m_windowTitleFont = m_windowTitleFontOriginal = nearestExistingFont(cg.readEntry("activeFont", m_defaultFont)); | 491 | m_windowTitleFont = m_windowTitleFontOriginal = nearestExistingFont(cg.readEntry("activeFont", m_defaultFont)); | ||
491 | 492 | | |||
493 | engine()->addImageProvider("preview", new PreviewImageProvider(generalFont())); | ||||
494 | | ||||
492 | emit generalFontChanged(); | 495 | emit generalFontChanged(); | ||
493 | emit fixedWidthFontChanged(); | 496 | emit fixedWidthFontChanged(); | ||
494 | emit smallFontChanged(); | 497 | emit smallFontChanged(); | ||
495 | emit toolbarFontChanged(); | 498 | emit toolbarFontChanged(); | ||
496 | emit menuFontChanged(); | 499 | emit menuFontChanged(); | ||
497 | emit windowTitleFontChanged(); | 500 | emit windowTitleFontChanged(); | ||
498 | 501 | | |||
499 | m_fontAASettings->load(); | 502 | m_fontAASettings->load(); | ||
▲ Show 20 Lines • Show All 199 Lines • Show Last 20 Lines |