-
-
Notifications
You must be signed in to change notification settings - Fork 77
Introduce PropertyAnimator #2573
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering whether it would be better to just have two utils methods something like this
Utils.prepare_animation (actor, time, mode);
// set actor properties
actor.translation_x = 5;
Utils.run_animation (actor, () => {
// do some stuff after the animation finished
});The utils methods would then just save and restore easing state depending on whether animations are enabled and the run_animation would then immediately call the callback or connect to the finished signal of an animation and then call the callback.
This would be less code and you can't accidentally write a property name wrong or have a type wrong.
This was just an idea and I'm open to other arguments though so lmk what you think 🤷
|
@leolost2605 I don't like this approach. The main downside of what you suggested is that there's no way to get the animated properties, so you have to use Clutter.Actor.transitions_completed and it can lead to some issues -- if you animate the actor two times, the on_stopped handlers might get fired at incorrect timing. I don't really like passing properties around as strings, but I don't think there's a way around that unfortunately =( For now I added a warning when property name is incorrect. I'll see if I can find more robust way to pass properties (GLib.ParamSpec maybe?) |
Converts some window manager effect to use PropertyAnimator, which can handle disabled animations correctly by itself.