From daf93671820c3e0111b418f99e768a4d13f7fea3 Mon Sep 17 00:00:00 2001 From: zhangkun2 Date: Mon, 14 Sep 2026 12:39:06 +0800 Subject: [PATCH] fix: align non-DCI icon visual size with DCI icons in fullscreen launcher Non-DCI icons (file:/// URLs from absolute icon paths in .desktop files) lack the built-in padding that the DCI format provides. When rendered at the same sourceSize as DCI icons, they fill the entire area and appear visually larger than system application icons. Add a conservative scale factor (0.85) for non-DCI icons in the imageComponent of IconItemDelegate.qml to compensate for the missing DCI padding, aligning their visual size with DCI icons. Log: fix fullscreen launcher icon size inconsistency between DCI and non-DCI icons Bug: https://pms.uniontech.com/bug-view-361477.html --- qml/IconItemDelegate.qml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qml/IconItemDelegate.qml b/qml/IconItemDelegate.qml index 189335f9..081c7817 100644 --- a/qml/IconItemDelegate.qml +++ b/qml/IconItemDelegate.qml @@ -314,12 +314,18 @@ Control { Component { id: imageComponent + // Non-DCI icons (file:/// URLs from absolute paths) lack the + // built-in padding that DCI format provides, causing them to + // appear visually larger than DCI icons at the same sourceSize. + // Apply a conservative scale factor to compensate. + readonly property real nonDciScaleFactor: 0.85 + DciIcon { objectName: "appIcon" anchors.fill: parent name: iconSource sourceSize: Qt.size(root.maxIconSize, root.maxIconSize) - scale: (iconContainer.width / root.maxIconSize) * root.iconScaleFactor + scale: (iconContainer.width / root.maxIconSize) * root.iconScaleFactor * (iconSource.startsWith("file:///") ? imageComponent.nonDciScaleFactor : 1.0) palette: DTK.makeIconPalette(root.palette) theme: ApplicationHelper.DarkType fillMode: Image.PreserveAspectFit