-
I am trying to animate the items inside a ListView as the items get added or removed (in this instance specifically a filter model). A couple simple video examples of the ideas I'm trying to implement:
The idea that I'm specifically trying to implement is that when the filter is applied the items no being shown slide out, and when the filter is removed the items slide back in. I have a rough example I created to test the idea that can be found at https://github.com/Vadoola/anim_list_items. Pressing the Toggle button filters in/out the "Text 2". In the slint code there are states and in/out animations to change the background color and opacity of the Rectangle. I've tried a handful of things and none of them seem to work. The items just appear and disappear instantly, with no animation. Is what I'm trying to achieve currently possible with Slint? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Ah, I guess what I essentially would be looking for are enter and leave animations which appear to not yet be supported: #3258 |
Beta Was this translation helpful? Give feedback.
For future reference to anyone who comes across this. I wasn't able to get anything working with "init" (maybe's it's possible but I didn't figure it out).
I did however get something working. It's a bit hacky, and I don't know if it will scale well, but it can be seen in this demo repo.
Essentially it uses a timer in the rust code to delay the filter_model.reset() when sliding out, and then uses an extra property tied to the position, and delays setting that with a timer after calling the filter_model.reset() on sliding in.
It would certainly be a lot cleaner, and…