on xenial help sign in
Test with carousel
commitcfd256a0c94ded2963567cc51882795d6915edf5 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateThu 21 Nov 2013, 11:01 (13 years ago) parent3be2689
1 file changed+2−2
Components/Carousel.qml+2−2
Components/Carousel.qml+2−2
@@ -65,6 +65,7 @@ Item {
6565 signal pressAndHold(int index, var model, real itemY)
6666
6767 implicitHeight: listView.tileHeight * selectedItemScaleFactor
68+ opacity: listView.highlightIndex === -1 ? 1 : 0.6
6869
6970 /* Basic idea behind the carousel effect is to move the items of the delegates (compacting /stuffing them).
7071 One drawback is, that more delegates have to be drawn than usually. As some items are moved from the
@@ -77,11 +78,11 @@ Item {
7778 ListView {
7879 id: listView
7980
81+ property int highlightIndex: -1
8082 property real minimumTileWidth: 0
8183 property real newContentX: disabledNewContentX
8284 property real pathItemCount: referenceWidth / referenceTileWidth
8385 property real tileAspectRatio: 1
84− property int highlightIndex: -1
8586
8687 /* The positioning and scaling of the items in the carousel is based on the variable
8788 'continuousIndex', a continuous real variable between [0, 'carousel.model.count'],
@@ -295,7 +296,6 @@ Item {
295296 scale: itemScale * explicitScaleFactor
296297 sourceComponent: itemComponent
297298 z: cachedTiles - Math.abs(index - listView.selectedIndex)
298− opacity: highlightIndex == -1 ? 1 : (highlightIndex == index ? 0.6 : 0.2)
299299
300300 transform: Translate {
301301 x: xTransform