Theme exports iconloader sizes

This commit is contained in:
Marco Martin 2011-10-30 19:07:58 +01:00
parent d0ad8eed35
commit 3c8ff37491
5 changed files with 58 additions and 6 deletions

View File

@ -19,6 +19,8 @@
#include "theme_p.h" #include "theme_p.h"
#include <KIconLoader>
class FontProxySingleton class FontProxySingleton
{ {
public: public:
@ -267,6 +269,35 @@ QString ThemeProxy::styleSheet() const
return Plasma::Theme::defaultTheme()->styleSheet(QString()); return Plasma::Theme::defaultTheme()->styleSheet(QString());
} }
int ThemeProxy::smallIconSize() const
{
return KIconLoader::SizeSmall;
}
int ThemeProxy::smallMediumIconSize() const
{
return KIconLoader::SizeSmallMedium;
}
int ThemeProxy::mediumIconSize() const
{
return KIconLoader::SizeMedium;
}
int ThemeProxy::largeIconSize() const
{
return KIconLoader::SizeLarge;
}
int ThemeProxy::hugeIconSize() const
{
return KIconLoader::SizeHuge;
}
int ThemeProxy::enormousIconSize() const
{
return KIconLoader::SizeEnormous;
}
#include "theme_p.moc" #include "theme_p.moc"

View File

@ -129,6 +129,14 @@ class ThemeProxy : public QObject
Q_PROPERTY(QColor viewFocusColor READ viewFocusColor NOTIFY themeChanged) Q_PROPERTY(QColor viewFocusColor READ viewFocusColor NOTIFY themeChanged)
Q_PROPERTY(QString styleSheet READ styleSheet NOTIFY themeChanged) Q_PROPERTY(QString styleSheet READ styleSheet NOTIFY themeChanged)
// icon sizes
Q_PROPERTY(int smallIconSize READ smallIconSize CONSTANT)
Q_PROPERTY(int smallMediumIconSize READ smallMediumIconSize CONSTANT)
Q_PROPERTY(int mediumIconSize READ mediumIconSize CONSTANT)
Q_PROPERTY(int largeIconSize READ largeIconSize CONSTANT)
Q_PROPERTY(int hugeIconSize READ hugeIconSize CONSTANT)
Q_PROPERTY(int enormousIconSize READ enormousIconSize CONSTANT)
public: public:
ThemeProxy(QObject *parent = 0); ThemeProxy(QObject *parent = 0);
~ThemeProxy(); ~ThemeProxy();
@ -158,6 +166,13 @@ public:
QColor viewFocusColor() const; QColor viewFocusColor() const;
QString styleSheet() const; QString styleSheet() const;
int smallIconSize() const;
int smallMediumIconSize() const;
int mediumIconSize() const;
int largeIconSize() const;
int hugeIconSize() const;
int enormousIconSize() const;
Q_SIGNALS: Q_SIGNALS:
void themeChanged(); void themeChanged();
}; };

View File

@ -45,9 +45,8 @@ Item {
valid = true valid = true
} }
//FIXME: iconloader sizes coming from plasma implicitWidth: theme.smallIconSize
implicitWidth: 16 implicitHeight: theme.smallIconSize
implicitHeight: 16
PlasmaCore.Svg { PlasmaCore.Svg {
id: svgIcon id: svgIcon

View File

@ -107,9 +107,8 @@ Item {
IconLoader { IconLoader {
id: imageLoader id: imageLoader
//FIXME: icon sizes in Theme implicitWidth: theme.smallIconSize
width : 16 implicitHeight: theme.smallIconSize
height : 16
anchors { anchors {
left: internal.portrait ? undefined : parent.left left: internal.portrait ? undefined : parent.left

View File

@ -24,6 +24,14 @@ ToolBar 0.1 ToolBar.qml
ToolButton 0.1 ToolButton.qml ToolButton 0.1 ToolButton.qml
ListItem 0.1 ToolButton.qml ListItem 0.1 ToolButton.qml
CommonDialog 0.1 CommonDialog.qml
Dialog 0.1 Dialog.qml
QueryDialog 0.1 QueryDialog.qml
SelectionDialog 0.1 SelectionDialog.qml
Page 0.1 Page.qml
PageStack 0.1 PageStack.qml
Window 0.1 Window.qml
TabBar 0.1 TabBar.qml TabBar 0.1 TabBar.qml
TabButton 0.1 TabButton.qml TabButton 0.1 TabButton.qml
TabGroup 0.1 TabGroup.qml TabGroup 0.1 TabGroup.qml