Skip to content

PC3/ProgressBar: Fix sizing bugs, reformat code, remove animation hacks

ivan tkachenko requested to merge work/ratijas/progress-pub into master

This patch makes implementation both simpler and more robust at once.

Parts of sizing expressions were copied from the Slider component, but adjusted for horizontal-only and legally-zero-progress usecase.

Fixed potentially undefined properties access for fixedMargins in Item context (a bug which is not reproducible with any of the stock themes, as they all provide size hints in their SVG).

Finally, the indeterminate animation was rewritten almost from scratch, so now an SVG item is properly animated from side to side, without going out of bound nor being unable to hit the farmost position. And it even handles mid-flight control resizing pretty well!

PS That children[0].height is a bit of an iffy hack. But introducing id to the inner component would prevent engine from optimizing the whole tree away when the background property is overridden. And using childrenRect.height results in binding loops because childrenRect (being a grouped property) updates for any geometry change. Ideally, I would factor it all out in a private/DefaultProgressBarBackground.qml, so that we could straight use an id, and don't worry about missing an optimization opportunity.

BUG: 456550

Edited by ivan tkachenko

Merge request reports