@@ -85,70 +85,20 @@ Item {
8585
8686 anchors.fill: parent
8787
88− Timer {
89− id: resizeTimer
90− interval: 100
91− repeat: false
92− onTriggered: {
93− dashContentList.currentIndex = dashContentList.currentIndexBeforeResize;
94− resetCurrentIndexTimer.stop();
95− dashContentList.currentIndexBeforeResize = -1;
96− }
97− }
98− Timer {
99− id: resetCurrentIndexTimer
100− interval: 1
101− repeat: false
102− onTriggered: {
103− dashContentList.currentIndex = dashContentList.currentIndexBeforeResize;
104− }
105− }
106−
107− function onSizeChanged() {
108− if (!resizeTimer.running) {
109− dashContentList.currentIndexBeforeResize = dashContentList.currentIndex;
110− resizeTimer.start();
111− } else {
112− resizeTimer.restart();
113− }
114− }
115−
116− onWidthChanged: {
117− onSizeChanged();
118− dashContentList.width = dashContentListHolder.width;
119− }
120−
121− onHeightChanged: {
122− onSizeChanged();
123− dashContentList.height = dashContentListHolder.height;
124− }
125−
12688 ListView {
12789 id: dashContentList
12890 objectName: "dashContentList"
12991
130− interactive: dashContent.scopes.loaded && !previewListView.open && currentItem && !currentItem.moving
131− && !resizeTimer.running
132−
133− property int currentIndexBeforeResize: -1
134− onCurrentIndexChanged: {
135− if (resizeTimer.running && currentIndex != currentIndexBeforeResize) {
136− // Bogus ListView currentIndex change caused by the resize.
137− // Work around this bug by resetting it to its value before the resize
138− // took place.
139− // But we have to do it outside its own onChanged slot, hence the timer.
140− resetCurrentIndexTimer.start();
141− }
142− }
92+ interactive: dashContent.scopes.loaded && currentItem && !currentItem.moving
14393
144− //anchors.fill: parent /* working around the "currentIndex change due to resize" bug */
94+ anchors.fill: parent
14595 model: dashContent.model
14696 orientation: ListView.Horizontal
14797 boundsBehavior: Flickable.DragAndOvershootBounds
14898 flickDeceleration: units.gu(625)
14999 maximumFlickVelocity: width * 5
150100 snapMode: ListView.SnapOneItem
151− highlightMoveDuration: 0 //250 /* working around the "currentIndex change due to resize" bug */
101+ highlightMoveDuration: 250
152102 highlightRangeMode: ListView.StrictlyEnforceRange
153103 // TODO Investigate if we can switch to a smaller cache buffer when/if UbuntuShape gets more performant
154104 cacheBuffer: 1073741823