@@ -28,15 +28,46 @@ Item {
29 property variant theHud
29 property variant theHud
30 property bool enabled: false
30 property bool enabled: false
31+ property bool preventHiding: dragArea.dragging
31 readonly property real bottomEdgeButtonCenterDistance: units.gu(34)
32 readonly property real bottomEdgeButtonCenterDistance: units.gu(34)
33− state: dragArea.status === DirectionalDragArea.Recognized ? "shown" : "hidden"
34+ state: "hidden"
37+ if (state == "hidden") {
40+ dismissTimer.restart()
44+ onPreventHidingChanged: {
45+ if (dismissTimer.running) {
46+ dismissTimer.restart();
54+ if (!bottombar.preventHiding) {
55+ bottombar.state = "hidden"
57+ dismissTimer.restart()
35 HudButton {
62 HudButton {
36 id: hudButton
63 id: hudButton
65+ readonly property bool centeredHud: parent.width < units.gu(68) // Nexus 7 has 67 gu width
38− x: MathLocal.clamp(dragArea.touchStartX - (width / 2), 0, bottombar.width - width)
67+ x: centeredHud ? parent.width / 2 - width / 2 : MathLocal.clamp(dragArea.touchStartX - (width / 2), 0, bottombar.width - width)
39 y: bottombar.height - bottomEdgeButtonCenterDistance - (height / 2) - bottomMargin
68 y: bottombar.height - bottomEdgeButtonCenterDistance - (height / 2) - bottomMargin
70+ visible: opacity != 0
41 mouseOver: {
72 mouseOver: {
42 if (dragArea.status === DirectionalDragArea.Recognized) {
73 if (dragArea.status === DirectionalDragArea.Recognized) {
@@ -55,13 +86,18 @@ Item {
57 Behavior on opacity {
88 Behavior on opacity {
58− NumberAnimation{ duration: 200; easing.type: Easing.OutCubic}
89+ NumberAnimation{duration: 200; easing.type: Easing.OutCubic}
62 Connections {
93 Connections {
63 target: theHud
94 target: theHud
64− onShownChanged: bottomBarVisibilityCommunicatorShell.forceHidden = theHud.shown
96+ bottomBarVisibilityCommunicatorShell.forceHidden = theHud.shown
98+ bottombar.state = "hidden"
67 EdgeDragArea {
103 EdgeDragArea {
@@ -70,6 +106,7 @@ Item {
70 height: distanceThreshold
106 height: distanceThreshold
71 anchors.bottom: parent.bottom
107 anchors.bottom: parent.bottom
109+ distanceThreshold: units.gu(8)
73 enabled: !theHud.shown && bottombar.enabled && applicationIsOnForeground
110 enabled: !theHud.shown && bottombar.enabled && applicationIsOnForeground
74 direction: Direction.Upwards
111 direction: Direction.Upwards
@@ -83,13 +120,23 @@ Item {
83 hudButton.clicked()
120 hudButton.clicked()
86− } else if (status === DirectionalDragArea.Undecided) {
123+ } else if (status === DirectionalDragArea.Undecided && !hudButton.centeredHud) {
87 touchStartX = touchX
124 touchStartX = touchX
125+ } else if (status === DirectionalDragArea.Recognized) {
126+ bottombar.state = "shown"
89 previousStatus = status
128 previousStatus = status
133+ anchors.fill: parent
134+ enabled: bottombar.state == "shown"
136+ bottombar.state = "hidden"
93 states: [
140 states: [
95 name: "hidden"
142 name: "hidden"
@@ -102,5 +149,4 @@ Item {
102 PropertyChanges { target: hudButton; bottomMargin: units.gu(0)}
149 PropertyChanges { target: hudButton; bottomMargin: units.gu(0)}