Skip to content

Conversation

@18202781743
Copy link
Contributor

@18202781743 18202781743 commented Aug 12, 2025

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

Summary by Sourcery

Bug Fixes:

  • Prevent icon blurring by moving updateDevicePixelRatio calls outside the ThemeIconName condition in both initialization and pixmapChange methods

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
@18202781743 18202781743 requested review from BLumia and mhduiy August 12, 2025 04:40
deepin-ci-robot added a commit to linuxdeepin/dtk6declarative that referenced this pull request Aug 12, 2025
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#512
Copy link

@sourcery-ai sourcery-ai bot left a 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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@sourcery-ai
Copy link

sourcery-ai bot commented Aug 12, 2025

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

This 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 initialization

sequenceDiagram
    participant DQuickIconImage
    participant DQuickIconImagePrivate
    DQuickIconImage->>DQuickIconImagePrivate: init()
    DQuickIconImagePrivate->>DQuickIconImagePrivate: updateDevicePixelRatio(1.0) (all icon types)
    DQuickIconImagePrivate->>DQuickIconImagePrivate: if iconType == ThemeIconName
    DQuickIconImagePrivate->>DQuickIconImagePrivate: connect iconThemeNameChanged
Loading

File-Level Changes

Change Details Files
Apply device pixel ratio update for all icons before type checks to prevent blurring
  • Moved updateDevicePixelRatio call outside ThemeIconName condition in init()
  • Updated pixmapChange to invoke updateDevicePixelRatio prior to maybeUpdateUrl
  • Removed redundant ThemeIconName guard around pixel ratio update
src/private/dquickiconimage.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link
Contributor

[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.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@18202781743 18202781743 merged commit 4eef277 into linuxdeepin:master Aug 13, 2025
17 of 20 checks passed
18202781743 pushed a commit to linuxdeepin/dtk6declarative that referenced this pull request Aug 13, 2025
Synchronize source files from linuxdeepin/dtkdeclarative.

Source-pull-request: linuxdeepin/dtkdeclarative#512
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants