fix: disable icon smooth to prevent blur at fractional scaling#728
Merged
BLumia merged 1 commit intolinuxdeepin:masterfrom Mar 10, 2026
Merged
fix: disable icon smooth to prevent blur at fractional scaling#728BLumia merged 1 commit intolinuxdeepin:masterfrom
BLumia merged 1 commit intolinuxdeepin:masterfrom
Conversation
Set smooth: false on icon items to fix rendering artifacts. 禁用图标组件的平滑属性以解决小图标模糊。 Log: 修复图标渲染模糊问题 PMS: BUG-271229 Influence: 小图标渲染更清晰,避免模糊伪影。
deepin pr auto review这段代码的 diff 主要涉及 QML 文件 1. 语法逻辑审查代码语法是正确的,没有明显的语法错误。修改主要是为 2. 代码质量审查
3. 代码性能审查
4. 代码安全审查
改进建议
改进后的代码示例// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later
ColumnLayout {
// ... 其他代码 ...
Image {
id: icon
source: "..."
palette: D.DTK.makeIconPalette(title.palette)
theme: D.DTK.toColorType(title.palette.window)
Layout.alignment: Qt.AlignHCenter
smooth: false // 禁用抗锯齿以提高性能
}
D.DciIcon {
id: dciIcon
source: "..."
palette: D.DTK.makeIconPalette(title.palette)
theme: D.DTK.toColorType(title.palette.window)
Layout.alignment: Qt.AlignHCenter
smooth: false // 禁用抗锯齿以提高性能
}
// ... 其他代码 ...
Button {
id: btn
// ... 其他属性 ...
Component.onCompleted: {
if (contentItem && typeof contentItem.smooth !== 'undefined') {
contentItem.smooth = false
}
}
background: ItemBackground {
button: btn
}
}
}详细解释
总结这段代码的修改主要是为了性能优化,通过禁用抗锯齿来提高渲染速度。改进后的代码增加了类型检查,提高了代码的健壮性。建议在实际应用中测试渲染效果,确保禁用抗锯齿不会影响视觉体验。 |
BLumia
approved these changes
Mar 10, 2026
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: BLumia, re2zero The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Set smooth: false on icon items to fix rendering artifacts.
禁用图标组件的平滑属性以解决小图标模糊。
Log: 禁用图标平滑渲染
PMS: BUG-271229
Influence: 提升启动器图标渲染性能,显示更加清晰锐利。