Skip to content

fix: reset icon scale when attention animation ends#1553

Merged
wjyrich merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-animationWithapp
Apr 14, 2026
Merged

fix: reset icon scale when attention animation ends#1553
wjyrich merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix-animationWithapp

Conversation

@wjyrich

@wjyrich wjyrich commented Apr 14, 2026

Copy link
Copy Markdown
Contributor
  1. Added onActiveChanged handler to reset icon.scale to 1.0 when attention animation becomes inactive
  2. This prevents the icon from remaining scaled after attention animation completes
  3. Fixes visual issue where icons could appear incorrectly scaled after attention animation

Log: Fixed taskbar icon scaling issue after attention animation

Influence:

  1. Test applications that trigger attention requests (like incoming messages)
  2. Verify that icons return to normal size after attention animation completes
  3. Check that icon scaling works correctly during animation
  4. Test with multiple attention animations in sequence
  5. Verify no visual artifacts remain after animation

fix: 修复注意力动画结束后图标缩放未重置的问题

  1. 添加 onActiveChanged 处理器,在注意力动画变为非活动状态时将 icon.scale 重置为 1.0
  2. 防止图标在注意力动画完成后保持缩放状态
  3. 修复注意力动画后图标可能显示不正确缩放的问题

Log: 修复任务栏图标在注意力动画后的缩放问题

Influence:

  1. 测试触发注意力请求的应用程序(如新消息通知)
  2. 验证图标在注意力动画完成后是否恢复正常大小
  3. 检查图标在动画期间的缩放是否正确
  4. 测试连续多个注意力动画的情况
  5. 验证动画后没有视觉残留问题

Summary by Sourcery

Bug Fixes:

  • Ensure the attention animation deactivation resets the app icon scale back to its normal size to prevent lingering visual scaling artifacts on the taskbar.

1. Added onActiveChanged handler to reset icon.scale to 1.0 when
attention animation becomes inactive
2. This prevents the icon from remaining scaled after attention
animation completes
3. Fixes visual issue where icons could appear incorrectly scaled after
attention animation

Log: Fixed taskbar icon scaling issue after attention animation

Influence:
1. Test applications that trigger attention requests (like incoming
messages)
2. Verify that icons return to normal size after attention animation
completes
3. Check that icon scaling works correctly during animation
4. Test with multiple attention animations in sequence
5. Verify no visual artifacts remain after animation

fix: 修复注意力动画结束后图标缩放未重置的问题

1. 添加 onActiveChanged 处理器,在注意力动画变为非活动状态时将
icon.scale 重置为 1.0
2. 防止图标在注意力动画完成后保持缩放状态
3. 修复注意力动画后图标可能显示不正确缩放的问题

Log: 修复任务栏图标在注意力动画后的缩放问题

Influence:
1. 测试触发注意力请求的应用程序(如新消息通知)
2. 验证图标在注意力动画完成后是否恢复正常大小
3. 检查图标在动画期间的缩放是否正确
4. 测试连续多个注意力动画的情况
5. 验证动画后没有视觉残留问题
@sourcery-ai

sourcery-ai Bot commented Apr 14, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Resets the taskbar app icon scale to its default when the attention animation stops being active to prevent persistent mis-scaling after the animation completes.

Sequence diagram for attention animation icon scaling reset

sequenceDiagram
    actor User
    participant App
    participant TaskManager
    participant AppItem
    participant AttentionEffect as AttentionAnimation
    participant Icon

    User->>App: Trigger attention event (e.g. incoming message)
    App->>TaskManager: Request attention for app window
    TaskManager->>AppItem: Set attention flag to true
    AppItem->>AttentionEffect: active = true
    loop While active
        AttentionEffect->>Icon: Apply scaling animation
    end
    TaskManager->>AppItem: Clear attention flag
    AppItem->>AttentionEffect: active = false
    AttentionEffect-->>AppItem: onActiveChanged triggered
    AppItem->>Icon: icon.scale = 1.0
Loading

State diagram for icon scale during attention animation

stateDiagram-v2
    [*] --> Idle

    Idle: Icon scale = 1.0

    Idle --> AttentionActive: Attention requested
    AttentionActive: Icon scale animated

    AttentionActive --> Idle: Attention no longer active
    note right of AttentionActive
      onActiveChanged
      if !active then icon.scale = 1.0
    end note
Loading

File-Level Changes

Change Details Files
Ensure the taskbar app icon scale is reset when the attention animation becomes inactive to avoid the icon remaining enlarged or shrunken after the animation ends.
  • Attach an onActiveChanged handler to the attention animation overlay item associated with root.attention
  • Within the handler, detect when the attention animation becomes inactive and explicitly set icon.scale back to 1.0
  • Keep the existing attention animation behavior otherwise unchanged
panels/dock/taskmanager/package/AppItem.qml

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Since icon.scale may be changed elsewhere (e.g., hover/press effects), consider resetting to the previous or default scale via a dedicated state/behavior instead of hard-coding 1.0 in onActiveChanged to avoid conflicts with other animations.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Since `icon.scale` may be changed elsewhere (e.g., hover/press effects), consider resetting to the previous or default scale via a dedicated state/behavior instead of hard-coding `1.0` in `onActiveChanged` to avoid conflicts with other animations.

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.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BLumia, wjyrich

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

@wjyrich wjyrich merged commit b4328cd into linuxdeepin:master Apr 14, 2026
11 of 12 checks passed
@wjyrich wjyrich deleted the fix-animationWithapp branch April 14, 2026 05:52
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