@@ -94,20 +94,70 @@ Item {
94 width: parent.width
94 width: parent.width
95 height: parent.height
95 height: parent.height
102+ dashContentList.currentIndex = dashContentList.currentIndexBeforeResize;
103+ resetCurrentIndexTimer.stop();
104+ dashContentList.currentIndexBeforeResize = -1;
108+ id: resetCurrentIndexTimer
112+ dashContentList.currentIndex = dashContentList.currentIndexBeforeResize;
116+ function onSizeChanged() {
117+ if (!resizeTimer.running) {
118+ dashContentList.currentIndexBeforeResize = dashContentList.currentIndex;
119+ resizeTimer.start();
121+ resizeTimer.restart();
127+ dashContentList.width = dashContentListHolder.width;
132+ dashContentList.height = dashContentListHolder.height;
97 ListView {
135 ListView {
98 id: dashContentList
136 id: dashContentList
99 objectName: "dashContentList"
137 objectName: "dashContentList"
101 interactive: dashContent.scopes.loaded && !previewListView.open && currentItem && !currentItem.moving
139 interactive: dashContent.scopes.loaded && !previewListView.open && currentItem && !currentItem.moving
140+ && !resizeTimer.running
142+ property int currentIndexBeforeResize: -1
143+ onCurrentIndexChanged: {
144+ if (resizeTimer.running && currentIndex != currentIndexBeforeResize) {
145+ // Bogus ListView currentIndex change caused by the resize.
146+ // Work around this bug by resetting it to its value before the resize
148+ // But we have to do it outside its own onChanged slot, hence the timer.
149+ resetCurrentIndexTimer.start();
103− anchors.fill: parent
153+ //anchors.fill: parent /* working around the "currentIndex change due to resize" bug */
104 model: dashContent.model
154 model: dashContent.model
105 orientation: ListView.Horizontal
155 orientation: ListView.Horizontal
106 boundsBehavior: Flickable.DragAndOvershootBounds
156 boundsBehavior: Flickable.DragAndOvershootBounds
107 flickDeceleration: units.gu(625)
157 flickDeceleration: units.gu(625)
108 maximumFlickVelocity: width * 5
158 maximumFlickVelocity: width * 5
109 snapMode: ListView.SnapOneItem
159 snapMode: ListView.SnapOneItem
110− highlightMoveDuration: 250
160+ highlightMoveDuration: 0 //250 /* working around the "currentIndex change due to resize" bug */
111 highlightRangeMode: ListView.StrictlyEnforceRange
161 highlightRangeMode: ListView.StrictlyEnforceRange
112 // TODO Investigate if we can switch to a smaller cache buffer when/if UbuntuShape gets more performant
162 // TODO Investigate if we can switch to a smaller cache buffer when/if UbuntuShape gets more performant
113 cacheBuffer: 1073741823
163 cacheBuffer: 1073741823