Skip to content
Verified Commit d202dc7f authored by ivan tkachenko's avatar ivan tkachenko 🗯
Browse files

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

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
parent 6730b7a8
Pipeline #231887 passed with stage
in 3 minutes and 29 seconds
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment