@@ -41,6 +41,13 @@ Showable {
41 duration: 350
41 duration: 350
42 to: openedHeight
42 to: openedHeight
43 easing.type: Easing.OutCubic
43 easing.type: Easing.OutCubic
45+ // Re-size if we've changed the openHeight while shown.
47+ if (indicators.shown) {
46 hideAnimation: StandardAnimation {
53 hideAnimation: StandardAnimation {
@@ -73,11 +80,11 @@ Showable {
75 function calculateCurrentItem(xValue, useBuffer) {
82 function calculateCurrentItem(xValue, useBuffer) {
76− var rowCoordinates
83+ var rowCoordinates;
77− var itemCoordinates
84+ var itemCoordinates;
78− var currentItem
85+ var currentItem;
79− var distanceFromRightEdge
86+ var distanceFromRightEdge;
80− var bufferExceeded = false
87+ var bufferExceeded = false;
82 if (indicators.state == "commit" || indicators.state == "locked" || showAnimation.running || hideAnimation.running) return;
89 if (indicators.state == "commit" || indicators.state == "locked" || showAnimation.running || hideAnimation.running) return;
@@ -162,8 +169,15 @@ Showable {
162 indicatorsModel: indicatorsModel
169 indicatorsModel: indicatorsModel
163 clip: !indicators.fullyOpened
170 clip: !indicators.fullyOpened
165− onMenuSelected: {
172+ Connections {
166− indicatorRow.setItem(index)
173+ target: indicatorRow
174+ onCurrentItemIndexChanged: menuContent.updateCurrentMenu();
177+ function updateCurrentMenu() {
178+ if (currentMenuIndex != indicatorRow.currentItemIndex) {
179+ currentMenuIndex = indicatorRow.currentItemIndex;
169 //small shadow gradient at bottom of menu
183 //small shadow gradient at bottom of menu
@@ -233,28 +247,35 @@ Showable {
233 indicatorsModel: indicatorsModel
247 indicatorsModel: indicatorsModel
234 state: indicators.state
248 state: indicators.state
236− onCurrentItemIndexChanged: menuContent.currentIndex = currentItemIndex
250+ Connections {
252+ onCurrentMenuIndexChanged: {
253+ indicatorRow.setCurrentItem(menuContent.currentMenuIndex);
239 Connections {
258 Connections {
240− target: hideAnimation
259+ target: showAnimation
241 onRunningChanged: {
260 onRunningChanged: {
242− if (hideAnimation.running) {
261+ if (showAnimation.running) {
243− indicators.state = "initial"
262+ indicators.state = "commit";
244− indicatorRow.currentItem = null;
248 Connections {
267 Connections {
249− target: showAnimation
268+ target: hideAnimation
250 onRunningChanged: {
269 onRunningChanged: {
251− if (showAnimation.running) {
270+ if (hideAnimation.running) {
252− indicators.calculateCurrentItem(dragHandle.touchX, false);
271+ indicators.state = "initial";
253− indicators.state = "commit";
272+ indicatorRow.currentItem = null;
277+ property var dragHandle: null
278+ // connections to the active drag handle
258 Connections {
279 Connections {
259 target: dragHandle
280 target: dragHandle
260 onTouchXChanged: {
281 onTouchXChanged: {
@@ -263,7 +284,6 @@ Showable {
266− property var dragHandle: showDragHandle.dragging ? showDragHandle : hideDragHandle
267 DragHandle {
287 DragHandle {
268 id: showDragHandle
288 id: showDragHandle
269 anchors.bottom: parent.bottom
289 anchors.bottom: parent.bottom
@@ -285,6 +305,9 @@ Showable {
285 menuContent.activateContent();
305 menuContent.activateContent();
308+ onDraggingChanged: {
309+ dragHandle = dragging ? showDragHandle : null;
289 DragHandle {
312 DragHandle {
290 id: hideDragHandle
313 id: hideDragHandle
@@ -296,6 +319,10 @@ Showable {
296 stretch: true
319 stretch: true
297 maxTotalDragDistance: openedHeight - panelHeight
320 maxTotalDragDistance: openedHeight - panelHeight
298 distanceThreshold: 0
321 distanceThreshold: 0
323+ onDraggingChanged: {
324+ dragHandle = dragging ? hideDragHandle : null;
301 states: [
328 states: [