on xenial help sign in
Test with carousel
cfd256aAndrea Cimitan
Components/Carousel.qml+2−2
@@ -65,6 +65,7 @@ Item {
65 signal pressAndHold(int index, var model, real itemY)
65 signal pressAndHold(int index, var model, real itemY)
66
66
67 implicitHeight: listView.tileHeight * selectedItemScaleFactor
67 implicitHeight: listView.tileHeight * selectedItemScaleFactor
68+ opacity: listView.highlightIndex === -1 ? 1 : 0.6
68
69
69 /* Basic idea behind the carousel effect is to move the items of the delegates (compacting /stuffing them).
70 /* Basic idea behind the carousel effect is to move the items of the delegates (compacting /stuffing them).
70 One drawback is, that more delegates have to be drawn than usually. As some items are moved from the
71 One drawback is, that more delegates have to be drawn than usually. As some items are moved from the
@@ -77,11 +78,11 @@ Item {
77 ListView {
78 ListView {
78 id: listView
79 id: listView
79
80
81+ property int highlightIndex: -1
80 property real minimumTileWidth: 0
82 property real minimumTileWidth: 0
81 property real newContentX: disabledNewContentX
83 property real newContentX: disabledNewContentX
82 property real pathItemCount: referenceWidth / referenceTileWidth
84 property real pathItemCount: referenceWidth / referenceTileWidth
83 property real tileAspectRatio: 1
85 property real tileAspectRatio: 1
84− property int highlightIndex: -1
85
86
86 /* The positioning and scaling of the items in the carousel is based on the variable
87 /* The positioning and scaling of the items in the carousel is based on the variable
87 'continuousIndex', a continuous real variable between [0, 'carousel.model.count'],
88 'continuousIndex', a continuous real variable between [0, 'carousel.model.count'],
@@ -295,7 +296,6 @@ Item {
295 scale: itemScale * explicitScaleFactor
296 scale: itemScale * explicitScaleFactor
296 sourceComponent: itemComponent
297 sourceComponent: itemComponent
297 z: cachedTiles - Math.abs(index - listView.selectedIndex)
298 z: cachedTiles - Math.abs(index - listView.selectedIndex)
298− opacity: highlightIndex == -1 ? 1 : (highlightIndex == index ? 0.6 : 0.2)
299
299
300 transform: Translate {
300 transform: Translate {
301 x: xTransform
301 x: xTransform