Port declarative theme away from KGlobalSettings`

This commit is contained in:
Sebastian Kügler 2013-10-05 06:18:50 +02:00
parent c244c5a24a
commit 6df4a21e8a
2 changed files with 13 additions and 2 deletions

View File

@ -46,14 +46,24 @@ ThemeProxy::ThemeProxy(QQmlEngine *parent)
connect(this, &Plasma::Theme::themeChanged, this, &ThemeProxy::themeChanged);
connect(KIconLoader::global(), SIGNAL(iconLoaderSettingsChanged()), this, SLOT(iconLoaderSettingsChanged()));
//connect(KGlobalSettings::self(), &KGlobalSettings::kdisplayFontChanged, this, &ThemeProxy::defaultFontChanged);
//connect(KGlobalSettings::self(), &KGlobalSettings::kdisplayFontChanged, this, &ThemeProxy::smallestFontChanged);
installEventFilter(qApp);
}
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
{
return Plasma::Theme::themeName();

View File

@ -136,6 +136,7 @@ Q_SIGNALS:
void smallestFontChanged();
private:
bool eventFilter(QObject *watched, QEvent *event);
int m_defaultIconSize;
QQmlPropertyMap *m_iconSizes;
QQmlEngine *m_engine;