From b57d69ef3bc75f48dca75af032e3af39558704ef Mon Sep 17 00:00:00 2001 From: wjyrich Date: Thu, 13 Nov 2025 14:41:36 +0800 Subject: [PATCH] fix: scale task manager preview icons for high DPI displays MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Added device pixel ratio scaling to icon size calculation 2. This ensures icons appear sharp and properly sized on high DPI screens 3. Previously used fixed PREVIEW_TITLE_HEIGHT resulted in blurry icons on high DPI displays 4. Now scales the icon pixmap according to the device's pixel ratio fix: 为高DPI显示器缩放任务管理器预览图标 1. 在图标尺寸计算中添加设备像素比缩放 2. 确保在高DPI屏幕上图标显示清晰且尺寸正确 3. 之前使用的固定PREVIEW_TITLE_HEIGHT在高DPI显示器上会导致图标模糊 4. 现在根据设备的像素比缩放图标像素图 PMS: BUG-336089 --- panels/dock/taskmanager/x11preview.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/panels/dock/taskmanager/x11preview.cpp b/panels/dock/taskmanager/x11preview.cpp index c7aa9da3b..31ac8d495 100644 --- a/panels/dock/taskmanager/x11preview.cpp +++ b/panels/dock/taskmanager/x11preview.cpp @@ -770,7 +770,8 @@ void X11WindowPreviewContainer::updatePreviewIconFromString(const QString &strin pix.loadFromData(QByteArray::fromBase64(strs.at(1).toLatin1())); } else { // is (likely) icon name from theme - pix = QIcon::fromTheme(stringData).pixmap(PREVIEW_TITLE_HEIGHT, PREVIEW_TITLE_HEIGHT); + const int scaledSize = PREVIEW_TITLE_HEIGHT * qApp->devicePixelRatio(); + pix = QIcon::fromTheme(stringData).pixmap(scaledSize, scaledSize); } if (pix.isNull()) {