Skip to content

armgit / krita

Public Imported from GitHub
0

Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.

C++

Allow higher resolution of thumbnails on Welcome Screen

Agata Cacko7fd986d1dff8
diff --git a/libs/ui/utils/KisRecentFileIconCache.cpp b/libs/ui/utils/KisRecentFileIconCache.cpp
index 5288113922..16074fcd95 100644
--- a/libs/ui/utils/KisRecentFileIconCache.cpp
+++ b/libs/ui/utils/KisRecentFileIconCache.cpp
@@ -72,6 +72,9 @@ KisRecentFileIconCache::KisRecentFileIconCache()
if (QThread::idealThreadCount() > 2) {
m_iconFetchThreadPool.setMaxThreadCount(2);
}
+ if (qApp) {
+ m_devicePixelRatioF = qMax(qApp->devicePixelRatio(), 1.0);
+ }
connect(qApp, SIGNAL(aboutToQuit()), SLOT(cleanupOnQuit()));
}
@@ -103,7 +106,7 @@ QIcon KisRecentFileIconCache::getOrQueueFileIcon(const QUrl &url)
const GetFileIconParameters param = {
url, // m_documentUrl
iconSize, // m_iconSize
- 1.0, // m_devicePixelRatioF
+ m_devicePixelRatioF, // m_devicePixelRatioF
};
QFuture<IconFetchResult> future = QtConcurrent::run(&m_iconFetchThreadPool, getFileIcon, param);
auto *watcher = new QFutureWatcher<IconFetchResult>(this);
diff --git a/libs/ui/utils/KisRecentFileIconCache.h b/libs/ui/utils/KisRecentFileIconCache.h
index f061e66bd7..acb4584605 100644
--- a/libs/ui/utils/KisRecentFileIconCache.h
+++ b/libs/ui/utils/KisRecentFileIconCache.h
@@ -21,6 +21,7 @@ class KisRecentFileIconCache : public QObject
QMap<QUrl, CacheItem> m_iconCacheMap;
QThreadPool m_iconFetchThreadPool;
+ float m_devicePixelRatioF {1.0};
public:
/**