Changeset View
Changeset View
Standalone View
Standalone View
src/libkirigami/platformtheme.cpp
Show First 20 Lines • Show All 87 Lines • ▼ Show 20 Line(s) | 37 | public: | |||
---|---|---|---|---|---|
88 | QColor customFocusColor; | 88 | QColor customFocusColor; | ||
89 | QColor customHoverColor; | 89 | QColor customHoverColor; | ||
90 | 90 | | |||
91 | QPalette customPalette; | 91 | QPalette customPalette; | ||
92 | 92 | | |||
93 | QFont font; | 93 | QFont font; | ||
94 | bool m_inherit = true; | 94 | bool m_inherit = true; | ||
95 | bool m_init = true; | 95 | bool m_init = true; | ||
96 | bool m_supportsIconColoring = false; | ||||
96 | 97 | | |||
97 | static KirigamiPluginFactory *s_pluginFactory; | 98 | static KirigamiPluginFactory *s_pluginFactory; | ||
98 | }; | 99 | }; | ||
99 | 100 | | |||
100 | KirigamiPluginFactory *PlatformThemePrivate::s_pluginFactory = nullptr; | 101 | KirigamiPluginFactory *PlatformThemePrivate::s_pluginFactory = nullptr; | ||
101 | 102 | | |||
102 | PlatformThemePrivate::PlatformThemePrivate(PlatformTheme *q) | 103 | PlatformThemePrivate::PlatformThemePrivate(PlatformTheme *q) | ||
103 | : q(q) | 104 | : q(q) | ||
▲ Show 20 Lines • Show All 582 Lines • ▼ Show 20 Line(s) | 686 | if (d->palette == palette) { | |||
686 | return; | 687 | return; | ||
687 | } | 688 | } | ||
688 | 689 | | |||
689 | d->palette = palette; | 690 | d->palette = palette; | ||
690 | PROPAGATECUSTOMCOLOR(Palette, palette) | 691 | PROPAGATECUSTOMCOLOR(Palette, palette) | ||
691 | emit paletteChanged(palette); | 692 | emit paletteChanged(palette); | ||
692 | } | 693 | } | ||
693 | 694 | | |||
694 | QIcon PlatformTheme::iconFromTheme(const QString &name, const QColor &customColor) | 695 | QIcon PlatformTheme::iconFromTheme(const QString &name, const QColor &customColor) | ||
davidedmundson: Is this useful if DesktopIcon does this anyway?
(or to turn the question around, can we do it… | |||||
695 | { | 696 | { | ||
696 | QIcon icon = QIcon::fromTheme(name); | 697 | QIcon icon = QIcon::fromTheme(name); | ||
697 | if (!icon.isNull() && (name.endsWith(QLatin1String("-symbolic")) || customColor != Qt::transparent)) { | | |||
698 | icon.setIsMask(true); | | |||
699 | } | | |||
700 | return icon; | 698 | return icon; | ||
701 | } | 699 | } | ||
702 | 700 | | |||
701 | bool PlatformTheme::supportsIconColoring() const | ||||
702 | { | ||||
703 | return d->m_supportsIconColoring; | ||||
704 | } | ||||
705 | | ||||
706 | void PlatformTheme::setSupportsIconColoring(bool support) | ||||
707 | { | ||||
708 | d->m_supportsIconColoring = support; | ||||
709 | } | ||||
703 | 710 | | |||
704 | 711 | | |||
705 | PlatformTheme *PlatformTheme::qmlAttachedProperties(QObject *object) | 712 | PlatformTheme *PlatformTheme::qmlAttachedProperties(QObject *object) | ||
706 | { | 713 | { | ||
707 | static bool s_factoryChecked = false; | 714 | static bool s_factoryChecked = false; | ||
708 | 715 | | |||
709 | //check for the plugin only once: it's an heavy operation | 716 | //check for the plugin only once: it's an heavy operation | ||
710 | if (PlatformThemePrivate::s_pluginFactory) { | 717 | if (PlatformThemePrivate::s_pluginFactory) { | ||
Show All 32 Lines |
Is this useful if DesktopIcon does this anyway?
(or to turn the question around, can we do it all here and have DesktopIcon only check isMask)