From e9ff8dce8f3732fc386e59dc5f275a74ff646d6a Mon Sep 17 00:00:00 2001 From: liujinchang Date: Tue, 17 Nov 2026 15:11:23 +0800 Subject: [PATCH] fix(editor): render dropdown arrows as vectors to keep them sharp under fractional scaling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Rerender the bottom bar dropdown arrow from SVG on every icon rebuild instead of reusing the bitmap cached at widget construction, so the arrow always matches the density of the text rendered into the same icon pixmap 修复(editor): 下拉箭头改为矢量渲染,修复分数倍缩放下箭头模糊 - 底栏下拉菜单每次重建图标时,普通态箭头与按压态 setSvgColor 同源,按当前图标密度从 SVG 矢量渲染,不再沿用构造期按当时缩放比光栅化的缓存位图(分数倍缩放比由主题层在窗口创建后异步应用,缓存位图会被拉伸显示而模糊) Log: 修复分数倍缩放(如 1.5)下底栏下拉菜单箭头模糊的问题 Bug: https://pms.uniontech.com/bug-view-171749.html PMS: BUG-171749 --- src/widgets/ddropdownmenu.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/widgets/ddropdownmenu.cpp b/src/widgets/ddropdownmenu.cpp index 843eb00fd..e43c4b68c 100644 --- a/src/widgets/ddropdownmenu.cpp +++ b/src/widgets/ddropdownmenu.cpp @@ -1,4 +1,4 @@ -// SPDX-FileCopyrightText: 2017 - 2023 UnionTech Software Technology Co., Ltd. +// SPDX-FileCopyrightText: 2017 - 2026 UnionTech Software Technology Co., Ltd. // // SPDX-License-Identifier: GPL-3.0-or-later @@ -372,7 +372,6 @@ QIcon DDropdownMenu::createIcon() arrowPixmap = setSvgColor(color); }else { textColor = dpalette.color(DPalette::WindowText); - arrowPixmap = m_arrowPixmap; } // 根据字体大小设置icon大小,按计算的字体高度,而非从字体文件中读取的高度(部分字体中英文高度不同) @@ -409,7 +408,17 @@ QIcon DDropdownMenu::createIcon() //arrowPixmap=arrowPixmap.scaled(iconW,iconH,Qt::IgnoreAspectRatio,Qt::SmoothTransformation); //qDebug()<<"==================="<