PC3/BusyIndicator: Fix alignment, hangs, port to Easing.OutCubic, and clean up
PC3/BusyIndicator: Center the active/rotating part of the control
Otherwise, with non 1:1 aspect ratios it would stick to top or left. For example, this problem can be observed by adding an icon applet to a panel, and launching it: busy indicator of the applet would not be canter-aligned to the icon, because of added padding making the applet container a slightly squashed rectangle.
PC3/BusyIndicator: Port opacity animation to Easing.OutCubic
See also: plasma-workspace!2185 (comment 534722)
PC3/BusyIndicator: Don't do extra work when animation starts
Item's rotation will be set by animator anyway, so let's focus on animator's properties and avoid triggering extra getters/setters.
PC3/BusyIndicator: Fix hang & rapid jump on start
Not only this patch simplified and optimizes binding of animationRunning, but it also actually fixes the bug when an indicator would fade in still and then rapidly rotates to catch up with its animation state.
Extra ID and binding on opacityAnimator.running is required due to the way Animator types work (they only trigger setter and property change signal when they stop).
PC3/BusyIndicator: Revert RotationAnimator back to property interceptor syntax
Saves on an extra unneeded ID, and adds docs explaining why the running
property can't be bound, and a procedural function is needed at all.
This is also a slight optimization, as property interceptors are
directly QObject-parented to their surrounding context, and don't go
to a "default property" list like children
or data
.
Test plan: verify that starting an app with a non-running BusyIndicator does not consume any amount of CPU.
Interestingly, many applets, including Networks and Bluetooth provide their own internal BusyIndicators instead of relying on Plasmoid.busy
property. Probably that's why the issue has gone unnoticed for such a long time.