-
Notifications
You must be signed in to change notification settings - Fork 55
fix: use transform for dock hide animation #1076
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
|
Skipping CI for Draft Pull Request. |
Reviewer's Guide by SourceryThis pull request refactors the dock hide animation to use a transform-based approach on X11 for smoother visual updates and positioning. It also fixes an issue where the blur area was not updating correctly with the dock's visual position. The changes involve modifying the animation target and logic, introducing a transform element, and adjusting the blur effect application. Sequence diagram for dock hide/show animation (X11)sequenceDiagram
participant Panel
participant Dock
participant dockTransform
Panel->>Dock: hideState changed
activate Dock
Dock->>hideShowAnimation: start()
activate hideShowAnimation
alt useTransformBasedAnimation is true (X11)
hideShowAnimation->>dockTransform: property = x or y
dockTransform-->>Panel: Animation updates position
else useTransformBasedAnimation is false (Wayland)
hideShowAnimation->>Dock: property = width or height
Dock-->>Panel: Animation updates size
end
hideShowAnimation-->>Dock: onStopped()
Dock->>Dock: visible = (x or y) == 0
deactivate hideShowAnimation
deactivate Dock
Updated class diagram for Dock componentclassDiagram
class Dock {
-PropertyAnimation hideShowAnimation
-bool useTransformBasedAnimation
-Item dockContainer
-Translate dockTransform
-D.StyledBehindWindowBlur blur
-GridLayout gridLayout
-Item dockLeftPart
-Item dockCenterPart
-Item dockRightPart
}
class Translate {
-id dockTransform
}
Dock --|> dockContainer : contains
Dock --|> hideShowAnimation : uses
dockContainer --|> Translate : contains
dockContainer --|> D.StyledBehindWindowBlur : contains
dockContainer --|> GridLayout : contains
GridLayout --|> Item : contains (dockLeftPart, dockCenterPart, dockRightPart)
note for Dock "Animation now uses transform on X11"
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
避免通过调整原始窗口高度来进行dock的显示\隐藏动画,以便使dock显示\隐 藏动画更流畅. Log:
deepin pr auto review代码审查意见:
总体来说,代码的修改提高了代码的可读性和性能,但需要注意保持代码的一致性和可维护性。 |
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 @BLumia - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider extracting the animation logic into a separate function for better readability.
- The conditional logic for
toinhideShowAnimationis a bit complex; can it be simplified?
Here's what I looked at during the review
- 🟢 General issues: all looks good
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, BLumia 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 |
注意:仅更改了 x11 下的行为,当前在 Treeland 下行为仍然是旧行为。
2025-04-01.17.11.24.mov
Summary by Sourcery
Refactor dock hide animation to use transform for smoother visual updates and positioning
Bug Fixes:
Enhancements:
Summary by Sourcery
Refactor dock hide animation to use transform-based positioning for smoother visual updates, with platform-specific behavior for X11 and Wayland
New Features:
Bug Fixes:
Enhancements: