Skip to content
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

gpui: Add transition animations #25602

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

someone13574
Copy link
Contributor

@someone13574 someone13574 commented Feb 25, 2025

Adds animations which provide an animation closure for interpolating between boolean states, mirroring the .when() and animation API's. This makes animations like hovers a lot easier.

I also implemented the Styled and InteractiveElement traits for AnimationElement and TransitionElement if E implements them, so that it is a bit easier to use wrapped elements.


Here is the updated animation example showing how easing and different forward/backward durations can be used:

2025-02-25.17-20-15.mp4

Release Notes:

  • N/A

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 25, 2025
@@ -54,15 +56,33 @@ impl Render for AnimationExample {
.size_8()
.path(ARROW_CIRCLE_SVG)
.text_color(black())
.id("svg")
.on_mouse_move(|_, _, _| {})
Copy link
Contributor Author

@someone13574 someone13574 Feb 26, 2025

Choose a reason for hiding this comment

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

Unrelated question: Does anyone know why I need another event handler for the on_hover to receive events? Is this intended?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant