export defaultIconSize

kept in sync with the kglobal desktop icon size
This commit is contained in:
Marco Martin 2012-02-20 15:09:26 +01:00
parent e6053a71dd
commit 7da705ba8a
2 changed files with 28 additions and 0 deletions

View File

@ -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"

View File

@ -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