slight shrik effect on the pixmap

svn path=/trunk/KDE/kdebase/workspace/lib/plasma/; revision=671927
This commit is contained in:
Siraj Razick 2007-06-05 20:44:28 +00:00
parent 11651586c0
commit 013fae0a0d

View File

@ -149,7 +149,15 @@ void Icon::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
if (!d->icon.isNull()) {
qreal deltaX = (d->size.width() - d->iconSize.width()) / 2;
qreal deltaY = (d->size.height() - d->iconSize.height()) / 2 ;
painter->drawPixmap(deltaX, deltaY, d->icon.pixmap(d->iconSize.toSize()));
if(d->state == Private::PressedState)
{
painter->drawPixmap(deltaX+2, deltaY-2, d->icon.pixmap(d->iconSize.toSize()-QSize(2,2)));
}
else
{
painter->drawPixmap(deltaX, deltaY, d->icon.pixmap(d->iconSize.toSize()));
}
}
//TODO: draw text