Port declarative theme away from KGlobalSettings`
This commit is contained in:
parent
c244c5a24a
commit
6df4a21e8a
@ -46,14 +46,24 @@ ThemeProxy::ThemeProxy(QQmlEngine *parent)
|
|||||||
connect(this, &Plasma::Theme::themeChanged, this, &ThemeProxy::themeChanged);
|
connect(this, &Plasma::Theme::themeChanged, this, &ThemeProxy::themeChanged);
|
||||||
connect(KIconLoader::global(), SIGNAL(iconLoaderSettingsChanged()), this, SLOT(iconLoaderSettingsChanged()));
|
connect(KIconLoader::global(), SIGNAL(iconLoaderSettingsChanged()), this, SLOT(iconLoaderSettingsChanged()));
|
||||||
|
|
||||||
//connect(KGlobalSettings::self(), &KGlobalSettings::kdisplayFontChanged, this, &ThemeProxy::defaultFontChanged);
|
installEventFilter(qApp);
|
||||||
//connect(KGlobalSettings::self(), &KGlobalSettings::kdisplayFontChanged, this, &ThemeProxy::smallestFontChanged);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ThemeProxy::~ThemeProxy()
|
ThemeProxy::~ThemeProxy()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ThemeProxy::eventFilter(QObject *watched, QEvent *event)
|
||||||
|
{
|
||||||
|
if (watched == QCoreApplication::instance()) {
|
||||||
|
if (event->type() == QEvent::ApplicationFontChange || event->type() == QEvent::FontChange) {
|
||||||
|
defaultFontChanged();
|
||||||
|
smallestFontChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return QObject::eventFilter(watched, event);
|
||||||
|
}
|
||||||
|
|
||||||
QString ThemeProxy::themeName() const
|
QString ThemeProxy::themeName() const
|
||||||
{
|
{
|
||||||
return Plasma::Theme::themeName();
|
return Plasma::Theme::themeName();
|
||||||
|
@ -136,6 +136,7 @@ Q_SIGNALS:
|
|||||||
void smallestFontChanged();
|
void smallestFontChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
bool eventFilter(QObject *watched, QEvent *event);
|
||||||
int m_defaultIconSize;
|
int m_defaultIconSize;
|
||||||
QQmlPropertyMap *m_iconSizes;
|
QQmlPropertyMap *m_iconSizes;
|
||||||
QQmlEngine *m_engine;
|
QQmlEngine *m_engine;
|
||||||
|
Loading…
Reference in New Issue
Block a user