@@ -107,20 +107,22 @@ Item {
107 height: distanceThreshold
107 height: distanceThreshold
108 anchors.bottom: parent.bottom
108 anchors.bottom: parent.bottom
110− distanceThreshold: units.gu(1)
110+ distanceThreshold: units.gu(8)
111 enabled: !theHud.shown && bottombar.enabled && applicationIsOnForeground
111 enabled: !theHud.shown && bottombar.enabled && applicationIsOnForeground
112 direction: Direction.Upwards
112 direction: Direction.Upwards
114 property int previousStatus: -1
114 property int previousStatus: -1
115 property real touchStartX: -1
115 property real touchStartX: -1
117+ readonly property real distanceFromThreshold: Math.max((-distance) - distanceThreshold, 0) // distance is negative
118+ readonly property real commitDistance: units.gu(6)
119+ readonly property real commitProgress: Math.min((distanceFromThreshold - commitDistance) / commitDistance, 1)
117 onStatusChanged: {
121 onStatusChanged: {
118 if (status === DirectionalDragArea.WaitingForTouch) {
122 if (status === DirectionalDragArea.WaitingForTouch) {
119 if (previousStatus == DirectionalDragArea.Recognized) {
123 if (previousStatus == DirectionalDragArea.Recognized) {
120 if (hudButton.mouseOver) {
124 if (hudButton.mouseOver) {
121 hudButton.clicked()
125 hudButton.clicked()
123− bottombar.state = "hidden"
126 } else if (status === DirectionalDragArea.Undecided) {
128 } else if (status === DirectionalDragArea.Undecided) {
@@ -128,10 +130,17 @@ Item {
128 touchStartX = touchX
130 touchStartX = touchX
130 } else if (status === DirectionalDragArea.Recognized) {
132 } else if (status === DirectionalDragArea.Recognized) {
131− bottombar.state = "shown"
133+ bottombar.state = "hint"
133 previousStatus = status
135 previousStatus = status
138+ onDistanceChanged: {
139+ if (status === DirectionalDragArea.Recognized) {
140+ if (distanceFromThreshold > commitDistance)
141+ bottombar.state = "shown"
137 MouseArea {
146 MouseArea {
@@ -153,6 +162,17 @@ Item {
153 PropertyChanges { target: hudButton; opacity: 0}
162 PropertyChanges { target: hudButton; opacity: 0}
154 PropertyChanges { target: hudButton; bottomMargin: units.gu(-1)}
163 PropertyChanges { target: hudButton; bottomMargin: units.gu(-1)}
169+ opacity: 0.5 + 0.5 * dragArea.commitProgress
173+ bottomMargin: units.gu(-1) + units.gu(1) * dragArea.commitProgress
157 name: "shown"
177 name: "shown"
158 PropertyChanges { target: hudButton; opacity: 1}
178 PropertyChanges { target: hudButton; opacity: 1}