diff --git a/declarativeimports/core/theme.cpp b/declarativeimports/core/theme.cpp index 702503d1f..526bdc27f 100644 --- a/declarativeimports/core/theme.cpp +++ b/declarativeimports/core/theme.cpp @@ -153,7 +153,10 @@ QSize FontProxy::mSize() const ThemeProxy::ThemeProxy(QObject *parent) : QObject(parent) { + m_defaultIconSize = KIconLoader::global()->currentSize(KIconLoader::Desktop); + connect(Plasma::Theme::defaultTheme(), SIGNAL(themeChanged()), this, SIGNAL(themeChanged())); + connect(KIconLoader::global(), SIGNAL(iconLoaderSettingsChanged()), this, SLOT(iconLoaderSettingsChanged())); } ThemeProxy::~ThemeProxy() @@ -305,5 +308,21 @@ int ThemeProxy::enormousIconSize() const return KIconLoader::SizeEnormous; } +void ThemeProxy::iconLoaderSettingsChanged() +{ + if (m_defaultIconSize == KIconLoader::global()->currentSize(KIconLoader::Desktop)) { + return; + } + + m_defaultIconSize = KIconLoader::global()->currentSize(KIconLoader::Desktop); + + emit defaultIconSizeChanged(); +} + +int ThemeProxy::defaultIconSize() const +{ + return m_defaultIconSize; +} + #include "theme.moc" diff --git a/declarativeimports/core/theme.h b/declarativeimports/core/theme.h index aa38b66f0..98747c10d 100644 --- a/declarativeimports/core/theme.h +++ b/declarativeimports/core/theme.h @@ -202,6 +202,7 @@ class ThemeProxy : public QObject Q_PROPERTY(int largeIconSize READ largeIconSize CONSTANT) Q_PROPERTY(int hugeIconSize READ hugeIconSize CONSTANT) Q_PROPERTY(int enormousIconSize READ enormousIconSize CONSTANT) + Q_PROPERTY(int defaultIconSize READ defaultIconSize NOTIFY defaultIconSizeChanged) public: ThemeProxy(QObject *parent = 0); @@ -238,9 +239,17 @@ public: int largeIconSize() const; int hugeIconSize() const; int enormousIconSize() const; + int defaultIconSize() const; + +private Q_SLOTS: + void iconLoaderSettingsChanged(); Q_SIGNALS: void themeChanged(); + void defaultIconSizeChanged(); + +private: + int m_defaultIconSize; }; #endif