feat: add smooth animation for prelaunch splash transition#813
feat: add smooth animation for prelaunch splash transition#813wineee wants to merge 9 commits intolinuxdeepin:masterfrom
Conversation
Added smooth geometry animation when transitioning from prelaunch splash to main surface content. Previously, the size change was abrupt when the prelaunch splash was destroyed. Now, when there's a significant size difference between the current implicit size and the target surface size, a smooth animation is applied to provide better visual experience. The implementation includes: 1. Added size comparison to detect when animation is needed 2. Created geometry animation using the animation engine 3. Added new slots to handle animation ready and finished events 4. Stored pending implicit size for animation completion 5. Used Q_ASSERT for connection verification Log: Added smooth transition animation when closing prelaunch splash screen Influence: 1. Test prelaunch splash with various surface sizes 2. Verify smooth animation when splash is destroyed 3. Check that connections are properly established 4. Test edge cases with same size transitions 5. Verify animation cleanup after completion 6. Test with different window states and geometries feat: 为预启动闪屏过渡添加平滑动画 在从预启动闪屏过渡到主表面内容时添加了平滑的几何动画。之前当预启动闪屏 被销毁时,尺寸变化是突兀的。现在当当前隐式尺寸与目标表面尺寸存在显著差异 时,会应用平滑动画以提供更好的视觉体验。 实现包括: 1. 添加尺寸比较以检测何时需要动画 2. 使用动画引擎创建几何动画 3. 添加新的槽函数处理动画准备和完成事件 4. 存储待处理的隐式尺寸用于动画完成 5. 使用 Q_ASSERT 进行连接验证 Log: 关闭预启动闪屏时添加平滑过渡动画 Influence: 1. 测试不同表面尺寸的预启动闪屏 2. 验证闪屏销毁时的平滑动画效果 3. 检查连接是否正确建立 4. 测试相同尺寸过渡的边缘情况 5. 验证动画完成后的清理工作 6. 测试不同窗口状态和几何形状
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wineee 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 |
Reviewer's GuideImplements a conditional geometry animation when destroying the prelaunch splash so that the SurfaceWrapper’s implicit size transitions smoothly to the main surface’s implicit size, wiring it into the existing animation engine and cleaning up the animation afterwards. Sequence diagram for prelaunch splash destroy with conditional geometry animationsequenceDiagram
actor User
participant SurfaceWrapper
participant WSurfaceItem
participant AnimationEngine as AnimationEngine
participant GeometryAnimation as GeometryAnimation
participant Container as Container
User->>SurfaceWrapper: onPrelaunchSplashDestroyRequested()
activate SurfaceWrapper
SurfaceWrapper->>WSurfaceItem: read implicitWidth(), implicitHeight()
SurfaceWrapper->>SurfaceWrapper: compute targetImplicitSize
SurfaceWrapper->>SurfaceWrapper: compare implicitSize vs targetImplicitSize
alt needImplicitSizeTransition and no m_geometryAnimation and container exists
SurfaceWrapper->>SurfaceWrapper: store m_pendingPrelaunchImplicitSize
SurfaceWrapper->>AnimationEngine: createGeometryAnimation(this, fromGeometry, toGeometry, container)
AnimationEngine-->>SurfaceWrapper: m_geometryAnimation
SurfaceWrapper->>GeometryAnimation: connect(ready, onPrelaunchGeometryAnimationReady)
SurfaceWrapper->>GeometryAnimation: connect(finished, onPrelaunchGeometryAnimationFinished)
SurfaceWrapper->>GeometryAnimation: invokeMethod(start)
GeometryAnimation-->>SurfaceWrapper: ready()
activate GeometryAnimation
SurfaceWrapper->>SurfaceWrapper: onPrelaunchGeometryAnimationReady()
SurfaceWrapper->>WSurfaceItem: connect implicitWidthChanged/implicitHeightChanged
SurfaceWrapper->>WSurfaceItem: connect boundingRectChanged
SurfaceWrapper->>SurfaceWrapper: setImplicitSize(m_pendingPrelaunchImplicitSize)
GeometryAnimation-->>SurfaceWrapper: finished()
SurfaceWrapper->>SurfaceWrapper: onPrelaunchGeometryAnimationFinished()
SurfaceWrapper->>GeometryAnimation: disconnect(this)
SurfaceWrapper->>GeometryAnimation: deleteLater()
SurfaceWrapper->>SurfaceWrapper: m_geometryAnimation = nullptr
deactivate GeometryAnimation
else no implicit size transition needed
SurfaceWrapper->>WSurfaceItem: connect implicitWidthChanged/implicitHeightChanged
SurfaceWrapper->>WSurfaceItem: connect boundingRectChanged
SurfaceWrapper->>SurfaceWrapper: setImplicitSize(targetImplicitSize)
end
SurfaceWrapper->>SurfaceWrapper: updateVisible()
SurfaceWrapper-->>User: prelaunchSplashChanged()
deactivate SurfaceWrapper
Updated class diagram for SurfaceWrapper prelaunch animation handlingclassDiagram
class SurfaceWrapper {
// Members
QPointer~QQuickItem~ m_coverContent
QPointer~QQuickItem~ m_prelaunchSplash
QList~WOutput*~ m_prelaunchOutputs
QSizeF m_pendingPrelaunchImplicitSize
QRectF m_boundedRect
QRectF m_normalGeometry
QRectF m_maximizedGeometry
QObject* m_geometryAnimation
AnimationEngine* m_engine
// Slots
void onPrelaunchSplashDestroyRequested()
void onPrelaunchGeometryAnimationReady()
void onPrelaunchGeometryAnimationFinished()
bool startStateChangeAnimation(State targetState, const QRectF &targetGeometry)
void onAnimationReady()
void onAnimationFinished()
void onWindowAnimationFinished()
void onShowAnimationFinished()
}
class WSurfaceItem {
qreal implicitWidth()
qreal implicitHeight()
signal implicitWidthChanged()
signal implicitHeightChanged()
signal boundingRectChanged()
}
class GeometryAnimation {
signal ready()
signal finished()
void start()
void deleteLater()
void disconnect(QObject* object)
}
class AnimationEngine {
GeometryAnimation* createGeometryAnimation(QObject* target, QRectF fromGeometry, QRectF toGeometry, QObject* container)
}
class QQuickItem {
}
class WOutput {
}
SurfaceWrapper --> WSurfaceItem : uses m_surfaceItem
SurfaceWrapper --> QQuickItem : uses container()
SurfaceWrapper --> WOutput : manages m_prelaunchOutputs
SurfaceWrapper --> GeometryAnimation : manages m_geometryAnimation
SurfaceWrapper --> AnimationEngine : uses m_engine
GeometryAnimation --> SurfaceWrapper : emits ready, finished signals to slots
WSurfaceItem --> SurfaceWrapper : emits implicitWidthChanged implicitHeightChanged boundingRectChanged to SurfaceWrapper
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
sudo rm -rf /var/lib/dde-dconfig-daemon/.config/global |
Added smooth geometry animation when transitioning from prelaunch splash to main surface content. Previously, the size change was abrupt when the prelaunch splash was destroyed. Now, when there's a significant size difference between the current implicit size and the target surface size, a smooth animation is applied to provide better visual experience.
The implementation includes:
Log: Added smooth transition animation when closing prelaunch splash screen
Influence:
feat: 为预启动闪屏过渡添加平滑动画
在从预启动闪屏过渡到主表面内容时添加了平滑的几何动画。之前当预启动闪屏
被销毁时,尺寸变化是突兀的。现在当当前隐式尺寸与目标表面尺寸存在显著差异
时,会应用平滑动画以提供更好的视觉体验。
实现包括:
Log: 关闭预启动闪屏时添加平滑过渡动画
Influence:
Summary by Sourcery
Add a smooth geometry-based transition when closing the prelaunch splash and handing over to the main surface content.
New Features:
Enhancements: