aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/controls/material/Tumbler.qml
diff options
context:
space:
mode:
authorJ-P Nurmi <jpnurmi@qt.io>2016-04-28 20:40:22 +0200
committerJ-P Nurmi <jpnurmi@qt.io>2016-04-29 12:45:12 +0000
commit3980354daa4d8dfa8ec07ed2c2265ebb137b6f36 (patch)
tree88d64fe36e91c0242767e1bb5b28f984f8a63882 /src/imports/controls/material/Tumbler.qml
parent8d340d7f3f28364d6b2b8fad2d4828ae761a2dad (diff)
Revert Tumbler::displacement to position changes
This reverts commits 150d8fcc7f97e4a5d56bdcf608fa22533d807677 and 0905066bcbb967d3344d399383d0ea4b30e1d489 that broke Tumbler. The normalized position calculation did not work in some corner cases (eg. when the total amount of model items is just 2). Therefore, just go back to "displacement"; and if we ever get this working correctly, we can call it position and deprecate displacement. Task-number: QTBUG-53061 Change-Id: Ic721f8a96c250dd5d40f881ff991fae687311996 Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Diffstat (limited to 'src/imports/controls/material/Tumbler.qml')
-rw-r--r--src/imports/controls/material/Tumbler.qml2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/imports/controls/material/Tumbler.qml b/src/imports/controls/material/Tumbler.qml
index f2b934fa..8ac8a7c4 100644
--- a/src/imports/controls/material/Tumbler.qml
+++ b/src/imports/controls/material/Tumbler.qml
@@ -50,7 +50,7 @@ T.Tumbler {
text: modelData
color: control.Material.primaryTextColor
font: control.font
- opacity: 1 - Math.abs(Tumbler.position * 0.8) * (control.enabled ? 1.0 : 0.4)
+ opacity: 0.4 + Math.max(0, 1 - Math.abs(Tumbler.displacement)) * 0.6
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}