Skip to content

ProgressBar: Replace hardcoded redraw interval with frame-based animations

ivan tkachenko requested to merge work/ratijas/timing into master

50 milliseconds is too slow, even for 60Hz monitors.

Implementation note: ScriptAction refuses to run in a loop on its own, and so does (or rather doesn't) SequentialAnimation with a single child ScriptAction. But having an empty bare NumberAnimation magically ties all this circus to the framerate of a monitor, but only if you set its duration to something non-zero, like 1ms here. «But wait! There is a specially tailored animation type for that!» you might say, «It's PauseAnimation!» Nope. With PauseAnimation of 0 is still refuses to run more than once, and with 1ms it spins at incredible thousands times per second eating as much CPU as it could grab — but only in the absence of another, frame based, animations of the scene — in which case it reverts back to "normal" well-behaved animation tied to a frame-rate. Don't ask me why.

KStyle_ProgressBar_timer

Merge request reports

Loading