Commit 5620d705 authored by Boris Egorov's avatar Boris Egorov Committed by Albert Astals Cid
Browse files

kmenuedit: do not resize app icons

We want to use icons size taken from KIconLoader::Small group and not
resize it to 20x20 pixels.

Use KIconLoader::currentSize() to determine icon size of dragged item.

Acked by Christoph Feck

BUGS:  338883
REVIEW: 120120
parent c8002fdd
......@@ -229,13 +229,6 @@ bool TreeItem::isLayoutDirty() const
static QPixmap appIcon(const QString &iconName)
{
QPixmap normal = KIconLoader::global()->loadIcon(iconName, KIconLoader::Small, 0, KIconLoader::DefaultState, QStringList(), 0L, true);
// make sure they are not larger than 20x20
if (normal.width() > 20 || normal.height() > 20)
{
QImage tmp = normal.toImage();
tmp = tmp.scaled(20, 20, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
normal = QPixmap::fromImage(tmp);
}
return normal;
}
......@@ -818,7 +811,8 @@ void TreeView::startDrag(Qt::DropActions supportedActions)
}
QDrag *drag = new QDrag(this);
drag->setPixmap(selectedItem()->icon(0).pixmap(24, 24));
int iconSize = KIconLoader::global()->currentSize(KIconLoader::Small);
drag->setPixmap(selectedItem()->icon(0).pixmap(iconSize, iconSize));
drag->setMimeData(data);
drag->exec(supportedActions, Qt::MoveAction);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment