App launcher: use scaled icons

This commit is contained in:
lupoDharkael
2018-01-18 18:21:40 +01:00
parent 16a082c713
commit 33ae4d9bc2

View File

@@ -44,10 +44,11 @@ void LauncherItemDelegate::paint(
const int halfIcon = iconSide/2;
const int halfWidth = rect.width()/2;
const int halfHeight = rect.height()/2;
QSize size(iconSide, iconSide);
QPixmap pixIcon = icon.pixmap(size).scaled(size);
painter->drawPixmap(rect.x() + (halfWidth - halfIcon),
rect.y()+ (halfHeight/2 - halfIcon),
iconSide, iconSide,
icon.pixmap(QSize(iconSide, iconSide)));
iconSide, iconSide, pixIcon);
const QRect textRect(rect.x(), rect.y() + halfHeight,
rect.width(), halfHeight);
painter->drawText(textRect, Qt::TextWordWrap | Qt::AlignHCenter,