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 436 Lines • ▼ Show 20 Line(s) | 485 | { | |||
494 | 495 | | |||
495 | m_toolbarFont = m_toolbarFontOriginal = nearestExistingFont(cg.readEntry("toolBarFont", m_defaultFont)); | 496 | m_toolbarFont = m_toolbarFontOriginal = nearestExistingFont(cg.readEntry("toolBarFont", m_defaultFont)); | ||
496 | 497 | | |||
497 | m_menuFont = m_menuFontOriginal = nearestExistingFont(cg.readEntry("menuFont", m_defaultFont)); | 498 | m_menuFont = m_menuFontOriginal = nearestExistingFont(cg.readEntry("menuFont", m_defaultFont)); | ||
498 | 499 | | |||
499 | cg = KConfigGroup(config, "WM"); | 500 | cg = KConfigGroup(config, "WM"); | ||
500 | m_windowTitleFont = m_windowTitleFontOriginal = nearestExistingFont(cg.readEntry("activeFont", m_defaultFont)); | 501 | m_windowTitleFont = m_windowTitleFontOriginal = nearestExistingFont(cg.readEntry("activeFont", m_defaultFont)); | ||
501 | 502 | | |||
503 | engine()->addImageProvider("preview", new PreviewImageProvider(generalFont())); | ||||
504 | | ||||
502 | emit generalFontChanged(); | 505 | emit generalFontChanged(); | ||
503 | emit fixedWidthFontChanged(); | 506 | emit fixedWidthFontChanged(); | ||
504 | emit smallFontChanged(); | 507 | emit smallFontChanged(); | ||
505 | emit toolbarFontChanged(); | 508 | emit toolbarFontChanged(); | ||
506 | emit menuFontChanged(); | 509 | emit menuFontChanged(); | ||
507 | emit windowTitleFontChanged(); | 510 | emit windowTitleFontChanged(); | ||
508 | 511 | | |||
509 | m_fontAASettings->load(); | 512 | m_fontAASettings->load(); | ||
▲ Show 20 Lines • Show All 199 Lines • Show Last 20 Lines |