POC - explore animations#655
Conversation
|
Do i get this right that outside of a running animation this has essentially 0 overhead? |
|
In reality I recently spent some times on this and I already have a bunch of branches that implements more or less all the "main animations". I still need to polish things up. Everything is opt-in for now because I would like to treat the animation as an experimental feature untill the official final animation release in iced. From a performance point of view I use the official low level iced animation API + iced_anim that's an utility library build on top of that API. Obviously there's a performance overhead because during the animation the widget requires extra draw call but it's normal in every library. The final result seems ok, I will create some working PR in the future. |
| (_, Displayed::Visible) => Some(theme.space.lg), | ||
| (_, Displayed::Hidden) => Some(theme.space.md), | ||
| }; | ||
| let name = w.name.clone(); |
There was a problem hiding this comment.
here we can replace the .clone() with .as_str()
iced::widget::text accepts &str directly and stores it as Fragment::Borrowed, which outlives the closure because its lifetime 'a matches the Element<'a> returned by view<'a>
| Some(match target_width { | ||
| Some(tw) => AnimationBuilder::new(tw, move |w| { | ||
| button( | ||
| container(text(name.clone()).size(font_size)) |
There was a problem hiding this comment.
and remove the .clone() here as well
|
I think that I will deprecate this PR. I had a final plan based on this POC that I will push in the next few days. @romanstingler makes a lot of sense. I will do that |
Fixed an
iced_layershellbug that prevents the animation redraw cycleAdd
iced_animas dep (not 100% sure about this decision)Add a simple width animation on workspace buttons
Add a (not so) simple animation to the window title