From 9c848ac283d1f76ffd930ed91555494425b0eb8d Mon Sep 17 00:00:00 2001 From: re2zero Date: Mon, 9 Feb 2026 14:40:12 +0800 Subject: [PATCH] fix(notification): improve text rendering at high DPI scaling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Set renderType to Text.QtRendering for all Text elements in notification content to fix faint font strokes at 4K 150% scaling. 修复通知中心在高DPI缩放下的字体渲染问题,为所有文本元素设置Qt渲染模式。 Log: 修复高DPI缩放下字体渲染问题 PMS: BUG-345405 Influence: 在4K 150%缩放下,通知文字的笔画(如"开"字的竖笔)现在显示清晰,与控制中心等其他控件的渲染效果保持一致。 --- panels/notification/plugin/NotifyItemContent.qml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/panels/notification/plugin/NotifyItemContent.qml b/panels/notification/plugin/NotifyItemContent.qml index d25ae9c76..82db8c8e2 100644 --- a/panels/notification/plugin/NotifyItemContent.qml +++ b/panels/notification/plugin/NotifyItemContent.qml @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -232,6 +232,7 @@ NotifyItem { text: root.appName font: DTK.fontManager.t10 color: palette.windowText + renderType: Text.QtRendering } Item { @@ -248,6 +249,7 @@ NotifyItem { text: root.date font: DTK.fontManager.t10 color: palette.windowText + renderType: Text.QtRendering } } } @@ -262,6 +264,7 @@ NotifyItem { bold: true } color: palette.windowText + renderType: Text.QtRendering wrapMode: Text.NoWrap elide: Text.ElideMiddle Layout.fillWidth: true @@ -278,7 +281,7 @@ NotifyItem { // text 宽度若让Layout通过implicitWidth计算会导致ListView的add动画出现位置错误,故这里手动计算Text的宽度 Layout.preferredWidth: NotifyStyle.contentItem.width - appIcon.width - appIcon.Layout.leftMargin - appIcon.Layout.rightMargin - - contentLayout.Layout.rightMargin - contentLayout.Layout.leftMargin + - contentLayout.Layout.rightMargin - contentLayout.Layout.leftMargin - (contentIconLoader.active ? (contentIconLoader.width + 1) : 0) - bodyRow.spacing * bodyRow.children.length - 1 visible: text !== "" @@ -286,6 +289,7 @@ NotifyItem { maximumLineCount: root.contentRowCount font: DTK.fontManager.t8 color: palette.windowText + renderType: Text.QtRendering wrapMode: Text.Wrap elide: Text.ElideRight linkColor: palette.highlight