-
Notifications
You must be signed in to change notification settings - Fork 42
fix: prevent icon blurring during scaling #512
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The changes modify how device pixel ratio updates are handled for icons to prevent blurring issues. Previously, the pixel ratio update was only applied to theme icons, but now it's applied universally to all icon types before checking the specific icon type. This ensures consistent scaling behavior across all icon types. The updateDevicePixelRatio call was moved outside the ThemeIconName condition check in both initialization and pixmapChange methods. This guarantees that all icons receive proper scaling treatment regardless of their type, fixing the blurring issue that occurred during scaling operations. Log: Fixed icon blurring issues during scaling operations Influence: 1. Test icon rendering at various zoom levels 2. Verify theme icons display clearly after scaling 3. Check non-theme icons for clarity after scaling 4. Test icon appearance across different DPI settings fix: 修复缩放导致的图标模糊问题 修改了图标设备像素比更新的处理方式以防止模糊问题。原先像素比更新仅应用于 主题图标,现在会在检查特定图标类型前统一应用于所有图标类型。这确保了所有 图标类型都能获得一致的缩放行为。 将updateDevicePixelRatio调用从ThemeIconName条件检查中移出,在初始化和 pixmapChange方法中都进行了此修改。这保证了所有图标都能获得适当的缩放处 理,修复了缩放操作导致的模糊问题。 Log: 修复了缩放操作导致的图标模糊问题 Influence: 1. 测试不同缩放级别下的图标渲染效果 2. 验证缩放后主题图标的清晰度 3. 检查非主题图标缩放后的清晰度 4. 测试不同DPI设置下的图标显示效果 PMS: BUG-321383
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#512
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @18202781743 - I've reviewed your changes - here's some feedback:
- Replace the hardcoded ‘1.0’ in updateDevicePixelRatio calls with a named constant or descriptive parameter to clarify its intent.
- Consider abstracting or centralizing the updateDevicePixelRatio invocation into a shared helper to reduce duplication and improve maintainability.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Replace the hardcoded ‘1.0’ in updateDevicePixelRatio calls with a named constant or descriptive parameter to clarify its intent.
- Consider abstracting or centralizing the updateDevicePixelRatio invocation into a shared helper to reduce duplication and improve maintainability.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR relocates the device pixel ratio update call outside the ThemeIconName condition in both init() and pixmapChange(), ensuring that updateDevicePixelRatio is applied to all icon types before any type-specific logic, which fixes icon blurring during scaling. Sequence diagram for icon scaling during initializationsequenceDiagram
participant DQuickIconImage
participant DQuickIconImagePrivate
DQuickIconImage->>DQuickIconImagePrivate: init()
DQuickIconImagePrivate->>DQuickIconImagePrivate: updateDevicePixelRatio(1.0) (all icon types)
DQuickIconImagePrivate->>DQuickIconImagePrivate: if iconType == ThemeIconName
DQuickIconImagePrivate->>DQuickIconImagePrivate: connect iconThemeNameChanged
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, mhduiy 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 |
Synchronize source files from linuxdeepin/dtkdeclarative. Source-pull-request: linuxdeepin/dtkdeclarative#512
The changes modify how device pixel ratio updates are handled for icons
to prevent blurring issues. Previously, the pixel ratio update was only
applied to theme icons, but now it's applied universally to all icon
types before checking the specific icon type. This ensures consistent
scaling behavior across all icon types.
The updateDevicePixelRatio call was moved outside the ThemeIconName
condition check in both initialization and pixmapChange methods. This
guarantees that all icons receive proper scaling treatment regardless
of their type, fixing the blurring issue that occurred during scaling
operations.
Log: Fixed icon blurring issues during scaling operations
Influence:
fix: 修复缩放导致的图标模糊问题
修改了图标设备像素比更新的处理方式以防止模糊问题。原先像素比更新仅应用于
主题图标,现在会在检查特定图标类型前统一应用于所有图标类型。这确保了所有
图标类型都能获得一致的缩放行为。
将updateDevicePixelRatio调用从ThemeIconName条件检查中移出,在初始化和
pixmapChange方法中都进行了此修改。这保证了所有图标都能获得适当的缩放处
理,修复了缩放操作导致的模糊问题。
Log: 修复了缩放操作导致的图标模糊问题
Influence:
PMS: BUG-321383
Summary by Sourcery
Bug Fixes: