From 7e4245f5e0807fd990cf8ace1c97923f9c4299eb Mon Sep 17 00:00:00 2001 From: yeshanshan Date: Thu, 17 Jul 2025 15:17:14 +0800 Subject: [PATCH] fix: handle empty icon name in notification item MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Modified DciIcon name property to use a fallback value when iconName is empty 2. Added default icon "application-x-desktop" to prevent missing icon display 3. Ensures notifications always show an appropriate icon even when none is specified fix: 处理通知项中图标名称为空的情况 1. 修改 DciIcon 的 name 属性,在 iconName 为空时使用回退值 2. 添加默认图标 "application-x-desktop" 防止图标缺失显示 3. 确保即使未指定图标时通知也能显示适当的图标 pms: BUG-311315 --- panels/notification/plugin/NotifyItemContent.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/panels/notification/plugin/NotifyItemContent.qml b/panels/notification/plugin/NotifyItemContent.qml index 42a79d9ce..5fce00190 100644 --- a/panels/notification/plugin/NotifyItemContent.qml +++ b/panels/notification/plugin/NotifyItemContent.qml @@ -124,7 +124,7 @@ NotifyItem { } DciIcon { - name: root.iconName + name: root.iconName !== "" ? root.iconName : "application-x-desktop" sourceSize: Qt.size(24, 24) Layout.alignment: Qt.AlignLeft | Qt.AlignTop Layout.topMargin: 8