Verified Commit c0000621 authored by ivan tkachenko's avatar ivan tkachenko
Browse files

ProgressBar,Slider: Draw position smoothly with greater precision

Modern screens are much bigger that 100px, especially when taking HiDPI
into account. So having integer bounds on a slider of a variable size
leads to a quite chunky and inaccurate progress animations.
parent 4eec9966
Pipeline #184801 passed with stage
in 1 minute and 14 seconds
......@@ -24,9 +24,9 @@ T.ProgressBar {
background: StylePrivate.StyleItem {
elementType: "progressbar"
control: controlRoot
maximum: indeterminate ? 0 : 100 * controlRoot.to
minimum: indeterminate ? 0 : 100 * controlRoot.from
value: indeterminate ? 0 : 100 * ((Qt.application.layoutDirection === Qt.LeftToRight ? controlRoot.visualPosition : 1 - controlRoot.visualPosition) * (controlRoot.to - controlRoot.from) + controlRoot.from)
maximum: indeterminate ? 0 : 10000 * controlRoot.to
minimum: indeterminate ? 0 : 10000 * controlRoot.from
value: indeterminate ? 0 : 10000 * ((Qt.application.layoutDirection === Qt.LeftToRight ? controlRoot.visualPosition : 1 - controlRoot.visualPosition) * (controlRoot.to - controlRoot.from) + controlRoot.from)
horizontal: true
enabled: controlRoot.enabled
......
......@@ -36,10 +36,10 @@ T.Slider {
contentHeight: horizontal ? (Kirigami.Settings.tabletMode ? 24 : 22) : controlRoot.implicitHeight
anchors.verticalCenter: controlRoot.verticalCenter
maximum: 100 * controlRoot.to
minimum: 100 * controlRoot.from
step: 100 * controlRoot.stepSize
value: 100 * controlRoot.value
maximum: 10000 * controlRoot.to
minimum: 10000 * controlRoot.from
step: 10000 * controlRoot.stepSize
value: 10000 * controlRoot.value
horizontal: controlRoot.orientation === Qt.Horizontal
enabled: controlRoot.enabled
hasFocus: controlRoot.activeFocus
......
Supports Markdown
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