-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
wip: animations for default widgets #1855
Conversation
315408b
to
0f5483f
Compare
0f5483f
to
300872d
Compare
just stumbled upon this and it looks really promising |
Any plan to merge this one? |
Hi ! I don't have a lot of time to work on this right now, but I believe we should have a discussion with @hecrj in order to figure out what is the best way to implement this. I know folks over at System76 have their own Cosmic time animation system and I don't want to step on their feet. However their system makes animations "external" to the widgets (at least from what I saw a while back, may have changed now), but I think it would be nice to have the animations system "internal" to widgets, at least for the ones that don't modify the layout. That way, users wouldn't have any extra work to do to have simple fade in/out animations for buttons, cursors, etc. |
The Idea behind this looks Solid so its just a matter of if Hector wants to take a look at it or if he rather you Post a topic about it first. |
Superseded by #2483. |
Hi!
This WIP implements default animations for default widgets. The goal here is to make Iced application appear smooth when hovering / clicking things, without breaking the API. It is also possible to keep the actual behavior (using a simple enum), although I do not know which should be default.
This heavily uses the new frame subscription API.
This is one thing that I was missing since transitioning from GTK, where you don't really need to worry about animations but can still end up with something that looks nice and smooth.
Current progress
Buttons
Buttons have smooth color transitions when hovered and pressed.
Kooha-2023-05-15-23-28-06.mp4
Things to discuss and fix:
Hovered
event in theupdate()
function?Text input (cursor)
In the text input, the cursor will fade-blink. It will however remain a full opacity while typing
Kooha-2023-05-15-23-36-43.mp4
Radio buttons
Radio buttons have smooth color transitions when hovered and pressed.
Kooha-2023-05-15-23-40-07.mp4
Togglers
Togglers have smooth color and movements transitions when pressed.
Kooha-2023-05-15-23-44-52.mp4
To do
Interferences
I stumbled upon cosmic-time, which implements a framework for animations in iced. From what I understand, it is made for more complex animations to be implemented by the user, whereas my goal is to bring default animations to Iced. However, I do not know if it would be better to use what has been made for cosmic-time for this or not. Or maybe this WIP is better suited to be used in cosmic-time after all.
I think default animations would be great, at least to be on par with GTK, but that's just IMO!
Thanks!