@@ -41,6 +41,13 @@ Showable {
4141 duration: 350
4242 to: openedHeight
4343 easing.type: Easing.OutCubic
44+
45+ // Re-size if we've changed the openHeight while shown.
46+ onToChanged: {
47+ if (indicators.shown) {
48+ indicators.show();
49+ }
50+ }
4451 }
4552
4653 hideAnimation: StandardAnimation {
@@ -73,11 +80,11 @@ Showable {
7380 }
7481
7582 function calculateCurrentItem(xValue, useBuffer) {
76− var rowCoordinates
77− var itemCoordinates
78− var currentItem
79− var distanceFromRightEdge
80− var bufferExceeded = false
83+ var rowCoordinates;
84+ var itemCoordinates;
85+ var currentItem;
86+ var distanceFromRightEdge;
87+ var bufferExceeded = false;
8188
8289 if (indicators.state == "commit" || indicators.state == "locked" || showAnimation.running || hideAnimation.running) return;
8390
@@ -162,8 +169,15 @@ Showable {
162169 indicatorsModel: indicatorsModel
163170 clip: !indicators.fullyOpened
164171
165− onMenuSelected: {
166− indicatorRow.setItem(index)
172+ Connections {
173+ target: indicatorRow
174+ onCurrentItemIndexChanged: menuContent.updateCurrentMenu();
175+ }
176+
177+ function updateCurrentMenu() {
178+ if (currentMenuIndex != indicatorRow.currentItemIndex) {
179+ currentMenuIndex = indicatorRow.currentItemIndex;
180+ }
167181 }
168182
169183 //small shadow gradient at bottom of menu
@@ -233,28 +247,35 @@ Showable {
233247 indicatorsModel: indicatorsModel
234248 state: indicators.state
235249
236− onCurrentItemIndexChanged: menuContent.currentIndex = currentItemIndex
250+ Connections {
251+ target: menuContent
252+ onCurrentMenuIndexChanged: {
253+ indicatorRow.setCurrentItem(menuContent.currentMenuIndex);
254+ }
255+ }
237256 }
238257
239258 Connections {
240− target: hideAnimation
259+ target: showAnimation
241260 onRunningChanged: {
242− if (hideAnimation.running) {
243− indicators.state = "initial"
244− indicatorRow.currentItem = null;
261+ if (showAnimation.running) {
262+ indicators.state = "commit";
245263 }
246264 }
247265 }
266+
248267 Connections {
249− target: showAnimation
268+ target: hideAnimation
250269 onRunningChanged: {
251− if (showAnimation.running) {
252− indicators.calculateCurrentItem(dragHandle.touchX, false);
253− indicators.state = "commit";
270+ if (hideAnimation.running) {
271+ indicators.state = "initial";
272+ indicatorRow.currentItem = null;
254273 }
255274 }
256275 }
257276
277+ property var dragHandle: null
278+ // connections to the active drag handle
258279 Connections {
259280 target: dragHandle
260281 onTouchXChanged: {
@@ -263,7 +284,6 @@ Showable {
263284 }
264285 }
265286
266− property var dragHandle: showDragHandle.dragging ? showDragHandle : hideDragHandle
267287 DragHandle {
268288 id: showDragHandle
269289 anchors.bottom: parent.bottom
@@ -285,6 +305,9 @@ Showable {
285305 menuContent.activateContent();
286306 }
287307 }
308+ onDraggingChanged: {
309+ dragHandle = dragging ? showDragHandle : null;
310+ }
288311 }
289312 DragHandle {
290313 id: hideDragHandle
@@ -296,6 +319,10 @@ Showable {
296319 stretch: true
297320 maxTotalDragDistance: openedHeight - panelHeight
298321 distanceThreshold: 0
322+
323+ onDraggingChanged: {
324+ dragHandle = dragging ? hideDragHandle : null;
325+ }
299326 }
300327
301328 states: [