use SmallIcon() to load icon and be sure that the proper size setting is used

IconSize() seems to not work when doubled icon size is checked in user settings
use a workaround instead

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=833344
This commit is contained in:
Loic Marteau 2008-07-16 17:23:35 +00:00
parent 56968db224
commit 7cb619cf68
2 changed files with 9 additions and 6 deletions

View File

@ -259,18 +259,18 @@ void AppletHandle::paint(QPainter *painter, const QStyleOptionGraphicsItem *opti
break;
}
painter->drawPixmap(basePoint + shiftM, KIcon("transform-scale").pixmap(m_iconSize, m_iconSize)); //FIXME no transform-resize icon
painter->drawPixmap(basePoint + shiftM, SmallIcon("transform-scale")); //FIXME no transform-resize icon
basePoint += step;
painter->drawPixmap(basePoint + shiftR, KIcon("transform-rotate").pixmap(m_iconSize, m_iconSize));
painter->drawPixmap(basePoint + shiftR, SmallIcon("transform-rotate"));
if (m_applet && m_applet->hasConfigurationInterface()) {
basePoint += step;
painter->drawPixmap(basePoint + shiftC, KIcon("configure").pixmap(m_iconSize, m_iconSize));
painter->drawPixmap(basePoint + shiftC, SmallIcon("configure"));
}
basePoint = m_rect.bottomLeft() + QPointF(HANDLE_MARGIN, 0) - step;
painter->drawPixmap(basePoint + shiftD, KIcon("edit-delete").pixmap(m_iconSize, m_iconSize));
painter->drawPixmap(basePoint + shiftD, SmallIcon("edit-delete"));
painter->restore();
}
@ -863,7 +863,10 @@ int AppletHandle::minimumHeight()
void AppletHandle::calculateSize()
{
m_iconSize = IconSize(KIconLoader::Small);
KIconLoader *iconLoader = new KIconLoader();
//m_iconSize = iconLoader->currentSize(KIconLoader::Small); //does not work with double sized icon
m_iconSize = iconLoader->loadIcon("transform-scale", KIconLoader::Small).width(); //workaround
delete iconLoader;
int handleHeight = minimumHeight();
int handleWidth = m_iconSize + 2 * HANDLE_MARGIN;

View File

@ -88,10 +88,10 @@ class AppletHandle : public QObject, public QGraphicsItem
QRectF m_rect;
QRectF m_totalRect;
int m_iconSize;
ButtonType m_pressedButton;
Containment *m_containment;
Applet *m_applet;
int m_iconSize;
qreal m_opacity;
FadeType m_anim;
int m_animId;