Skip to content

POC - explore animations#655

Draft
MalpenZibo wants to merge 1 commit intomainfrom
feat/explore-animations
Draft

POC - explore animations#655
MalpenZibo wants to merge 1 commit intomainfrom
feat/explore-animations

Conversation

@MalpenZibo
Copy link
Copy Markdown
Owner

  • Fixed an iced_layershell bug that prevents the animation redraw cycle

  • Add iced_anim as 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

@MalpenZibo MalpenZibo marked this pull request as draft April 18, 2026 10:36
@MalpenZibo MalpenZibo changed the base branch from main to refactor/shared-components April 18, 2026 10:36
@MalpenZibo MalpenZibo mentioned this pull request Apr 18, 2026
7 tasks
Base automatically changed from refactor/shared-components to main April 18, 2026 14:42
@clotodex
Copy link
Copy Markdown
Collaborator

Do i get this right that outside of a running animation this has essentially 0 overhead?
If so this is amazing and i would add a global option for turning off animations

@MalpenZibo
Copy link
Copy Markdown
Owner Author

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.

Comment thread src/modules/workspaces.rs
(_, Displayed::Visible) => Some(theme.space.lg),
(_, Displayed::Hidden) => Some(theme.space.md),
};
let name = w.name.clone();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

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>

Comment thread src/modules/workspaces.rs
Some(match target_width {
Some(tw) => AnimationBuilder::new(tw, move |w| {
button(
container(text(name.clone()).size(font_size))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

and remove the .clone() here as well

@MalpenZibo
Copy link
Copy Markdown
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants