Changeset View
Changeset View
Standalone View
Standalone View
src/controls/private/globaltoolbar/BreadcrumbControl.qml
Show All 17 Lines | 14 | Flickable { | |||
---|---|---|---|---|---|
18 | 18 | | |||
19 | contentHeight: height | 19 | contentHeight: height | ||
20 | contentWidth: mainLayout.width | 20 | contentWidth: mainLayout.width | ||
21 | clip: true | 21 | clip: true | ||
22 | boundsBehavior: Flickable.StopAtBounds | 22 | boundsBehavior: Flickable.StopAtBounds | ||
23 | 23 | | |||
24 | Connections { | 24 | Connections { | ||
25 | target: pageRow | 25 | target: pageRow | ||
26 | onCurrentIndexChanged: { | 26 | function onCurrentIndexChanged() { | ||
27 | var currentItem = mainLayout.children[pageRow.currentIndex]; | 27 | var currentItem = mainLayout.children[pageRow.currentIndex]; | ||
28 | listScrollAnim.running = false | 28 | listScrollAnim.running = false | ||
29 | listScrollAnim.from = root.contentX; | 29 | listScrollAnim.from = root.contentX; | ||
30 | listScrollAnim.to = Math.max( 0, | 30 | listScrollAnim.to = Math.max( 0, | ||
31 | Math.min(currentItem.x + currentItem.width/2 - root.width/2, | 31 | Math.min(currentItem.x + currentItem.width/2 - root.width/2, | ||
32 | root.contentWidth - root.width)) | 32 | root.contentWidth - root.width)) | ||
33 | listScrollAnim.running = true; | 33 | listScrollAnim.running = true; | ||
34 | } | 34 | } | ||
▲ Show 20 Lines • Show All 61 Lines • Show Last 20 Lines |