slight shrik effect on the pixmap
svn path=/trunk/KDE/kdebase/workspace/lib/plasma/; revision=671927
This commit is contained in:
parent
11651586c0
commit
013fae0a0d
@ -149,9 +149,17 @@ void Icon::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
|
|||||||
if (!d->icon.isNull()) {
|
if (!d->icon.isNull()) {
|
||||||
qreal deltaX = (d->size.width() - d->iconSize.width()) / 2;
|
qreal deltaX = (d->size.width() - d->iconSize.width()) / 2;
|
||||||
qreal deltaY = (d->size.height() - d->iconSize.height()) / 2 ;
|
qreal deltaY = (d->size.height() - d->iconSize.height()) / 2 ;
|
||||||
|
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()));
|
painter->drawPixmap(deltaX, deltaY, d->icon.pixmap(d->iconSize.toSize()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//TODO: draw text
|
//TODO: draw text
|
||||||
|
|
||||||
if (d->svgElements & Private::SvgForeground) {
|
if (d->svgElements & Private::SvgForeground) {
|
||||||
|
Loading…
Reference in New Issue
Block a user