X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/8679115552ec65ccfc6cbc1db68414d80e3a081b..d48b733:/src/kitemviews/kfileitemlistview.cpp diff --git a/src/kitemviews/kfileitemlistview.cpp b/src/kitemviews/kfileitemlistview.cpp index d249bef91..1b6071820 100644 --- a/src/kitemviews/kfileitemlistview.cpp +++ b/src/kitemviews/kfileitemlistview.cpp @@ -29,6 +29,8 @@ #include #include +#include +#include // #define KFILEITEMLISTVIEW_DEBUG @@ -41,7 +43,7 @@ namespace { // If the icon size changes, a longer delay is used. This prevents that // the expensive re-generation of all previews is triggered repeatedly when - // chaning the zoom level. + // changing the zoom level. const int LongInterval = 300; } @@ -154,21 +156,23 @@ QPixmap KFileItemListView::createDragPixmap(const KItemSet& indexes) const yCount = xCount; } + const qreal dpr = scene()->views()[0]->devicePixelRatio(); // Draw the selected items into the grid cells. - QPixmap dragPixmap(xCount * size + xCount, yCount * size + yCount); + QPixmap dragPixmap(QSize(xCount * size + xCount, yCount * size + yCount) * dpr); + dragPixmap.setDevicePixelRatio(dpr); dragPixmap.fill(Qt::transparent); QPainter painter(&dragPixmap); int x = 0; int y = 0; - foreach (int index, indexes) { + for (int index : indexes) { QPixmap pixmap = model()->data(index).value("iconPixmap").value(); if (pixmap.isNull()) { QIcon icon = QIcon::fromTheme(model()->data(index).value("iconName").toString()); pixmap = icon.pixmap(size, size); } else { - KPixmapModifier::scale(pixmap, QSize(size, size)); + KPixmapModifier::scale(pixmap, QSize(size, size) * dpr); } painter.drawPixmap(x, y, pixmap);