39
bottombar.state = "hidden"
42
onApplicationIsOnForegroundChanged: {
43
if (!applicationIsOnForeground) {
38
49
if (state == "hidden") {
39
50
dismissTimer.stop()
51
bottomBarVisibilityCommunicatorShell.forceHidden = false
41
53
dismissTimer.restart()
45
57
onPreventHidingChanged: {
59
if (state == "hint" || state == "reveal")
46
63
if (dismissTimer.running) {
47
64
dismissTimer.restart();
123
objectName: "hudDragArea"
106
124
width: parent.width
107
125
height: distanceThreshold
108
126
anchors.bottom: parent.bottom
110
distanceThreshold: units.gu(1)
128
distanceThreshold: units.gu(8)
111
129
enabled: !theHud.shown && bottombar.enabled && applicationIsOnForeground
112
130
direction: Direction.Upwards
114
133
property int previousStatus: -1
115
134
property real touchStartX: -1
136
readonly property real distanceFromThreshold: (-distance) - distanceThreshold // distance is negative
137
readonly property real revealDistance: units.gu(2)
138
readonly property real commitDistance: units.gu(6)
139
readonly property real commitProgress: MathLocal.clamp(distanceFromThreshold / commitDistance, 0, 1)
117
141
onStatusChanged: {
118
142
if (status === DirectionalDragArea.WaitingForTouch) {
119
143
if (previousStatus == DirectionalDragArea.Recognized) {
120
144
if (hudButton.mouseOver) {
121
145
hudButton.clicked()
123
bottombar.state = "hidden"
126
148
} else if (status === DirectionalDragArea.Undecided) {
128
150
touchStartX = touchX
130
152
} else if (status === DirectionalDragArea.Recognized) {
131
bottombar.state = "shown"
153
bottombar.state = "hint"
133
155
previousStatus = status
159
if (status === DirectionalDragArea.Recognized) {
160
if (distanceFromThreshold > commitDistance)
161
bottombar.state = "shown"
162
else if (distanceFromThreshold > revealDistance)
163
bottombar.state = "reveal"
175
height: parent.height - bottomBarVisibilityCommunicatorShell.position
179
enabled: bottombar.state == "shown"
181
bottomBarVisibilityCommunicatorShell.forceHidden = true
182
bottombar.state = "hidden"
188
blockInput: (hudButton.opacity == 1)
139
enabled: bottombar.state == "shown"
194
top: dismissArea.bottom
197
bottom: parent.bottom
199
enabled: bottombar.state == "shown" && bottomBarVisibilityCommunicatorShell.position > 0
141
201
bottombar.state = "hidden"
147
blockInput: (hudButton.opacity == 1)
153
PropertyChanges { target: hudButton; opacity: 0}
154
PropertyChanges { target: hudButton; bottomMargin: units.gu(-1)}
208
PropertyChanges { target: hudButton; opacity: 0 }
209
PropertyChanges { target: hudButton; bottomMargin: units.gu(-2) }
214
PropertyChanges { target: hudButton; opacity: 0.5 }
219
PropertyChanges { target: hudButton; bottomMargin: units.gu(-2) + units.gu(2) * dragArea.commitProgress }
158
PropertyChanges { target: hudButton; opacity: 1}
159
PropertyChanges { target: hudButton; bottomMargin: units.gu(0)}
223
PropertyChanges { target: hudButton; opacity: 1 }
224
PropertyChanges { target: hudButton; bottomMargin: units.gu(0) }