@@ -25,14 +25,12 @@ import "../Components/Math.js" as MathLocal
26 id: indicators
26 id: indicators
28− property int referenceOpenedHeight: units.gu(71)
28+ property real openedHeight: units.gu(71)
29− property real openedHeight: pinnedMode ? referenceOpenedHeight - panelHeight
30− : referenceOpenedHeight
31 property int panelHeight: units.gu(3)
29 property int panelHeight: units.gu(3)
32 property bool pinnedMode: true //should be set true if indicators menu can cover whole screen
30 property bool pinnedMode: true //should be set true if indicators menu can cover whole screen
34 property int hintValue
32 property int hintValue
35− readonly property int lockThreshold: referenceOpenedHeight / 2
33+ readonly property int lockThreshold: openedHeight / 2
36 property bool fullyOpened: height == openedHeight
34 property bool fullyOpened: height == openedHeight
37 property bool partiallyOpened: height > panelHeight && !fullyOpened
35 property bool partiallyOpened: height > panelHeight && !fullyOpened
@@ -56,18 +54,20 @@ Showable {
57 onHeightChanged: {
55 onHeightChanged: {
58 // need to use handle.get_height(). As the handle height depends on indicators.height changes (but this is called first!)
56 // need to use handle.get_height(). As the handle height depends on indicators.height changes (but this is called first!)
59− var contentProgress = indicators.height - handle.get_height();
57+ var revealProgress = indicators.height - panelHeight
60 if (!showAnimation.running && !hideAnimation.running) {
58 if (!showAnimation.running && !hideAnimation.running) {
59+ if (revealProgress == 0) {
60+ indicators.state = "initial"
61− if (contentProgress <= hintValue && indicators.state == "reveal") {
61+ } else if (revealProgress <= hintValue && indicators.state == "reveal") {
62 indicators.state = "hint";
62 indicators.state = "hint";
63− } else if (contentProgress > hintValue && contentProgress < lockThreshold) {
63+ } else if (revealProgress > hintValue && revealProgress < lockThreshold) {
64 indicators.state = "reveal";
64 indicators.state = "reveal";
65− } else if (contentProgress >= lockThreshold && lockThreshold > 0) {
65+ } else if (revealProgress >= lockThreshold && lockThreshold > 0) {
66 indicators.state = "locked";
66 indicators.state = "locked";
70− if (contentProgress == 0) {
70+ if (revealProgress == 0) {
71 menuContent.releaseContent();
71 menuContent.releaseContent();
@@ -155,7 +155,7 @@ Showable {
155 left: parent.left
155 left: parent.left
156 right: parent.right
156 right: parent.right
157 top: indicatorRow.bottom
157 top: indicatorRow.bottom
158− bottom: parent.bottom
158+ bottom: handle.top
160 indicatorsModel: indicatorsModel
160 indicatorsModel: indicatorsModel
161 clip: !indicators.fullyOpened
161 clip: !indicators.fullyOpened
@@ -188,7 +188,7 @@ Showable {
188 anchors {
188 anchors {
189 left: parent.left
189 left: parent.left
190 right: parent.right
190 right: parent.right
191− top: menuContent.bottom
191+ bottom: parent.bottom
193 height: get_height()
193 height: get_height()
194 clip: height < handleImage.height
194 clip: height < handleImage.height
@@ -212,33 +212,14 @@ Showable {
215− PanelSeparatorLine {
216− id: indicatorsSeparatorLine
220− left: indicators.left
221− right: indicators.right
229− bottom: indicatorsSeparatorLine.bottom
230− left: indicators.left
231− right: indicators.right
232− margins: -units.gu(1)
234− visible: indicators.height > panelHeight
235− source: "graphics/rectangular_dropshadow.sci"
238 PanelBackground {
215 PanelBackground {
239 anchors.fill: indicatorRow
216 anchors.fill: indicatorRow
219+ IndicatorsDataModel {
242 IndicatorRow {
223 IndicatorRow {
243 id: indicatorRow
224 id: indicatorRow
244 objectName: "indicatorRow"
225 objectName: "indicatorRow"
@@ -251,11 +232,6 @@ Showable {
251 state: indicators.state
232 state: indicators.state
253 onCurrentItemIndexChanged: menuContent.currentIndex = currentItemIndex
234 onCurrentItemIndexChanged: menuContent.currentIndex = currentItemIndex
257− IndicatorsDataModel {
261 Connections {
237 Connections {
@@ -314,7 +290,7 @@ Showable {
314 hintDisplacement: pinnedMode ? indicators.hintValue : 0
290 hintDisplacement: pinnedMode ? indicators.hintValue : 0
315 autoCompleteDragThreshold: maxTotalDragDistance / 2
291 autoCompleteDragThreshold: maxTotalDragDistance / 2
316 stretch: true
292 stretch: true
317− maxTotalDragDistance: openedHeight - handle.height
293+ maxTotalDragDistance: openedHeight - panelHeight
318 distanceThreshold: pinnedMode ? 0 : units.gu(3)
294 distanceThreshold: pinnedMode ? 0 : units.gu(3)
320 onStatusChanged: {
296 onStatusChanged: {
@@ -326,13 +302,12 @@ Showable {
326 DragHandle {
302 DragHandle {
327 id: hideDragHandle
303 id: hideDragHandle
328 anchors.fill: handle
304 anchors.fill: handle
330 direction: Direction.Upwards
305 direction: Direction.Upwards
331 enabled: indicators.shown
306 enabled: indicators.shown
332 hintDisplacement: units.gu(2)
307 hintDisplacement: units.gu(2)
333 autoCompleteDragThreshold: maxTotalDragDistance / 6
308 autoCompleteDragThreshold: maxTotalDragDistance / 6
334 stretch: true
309 stretch: true
335− maxTotalDragDistance: referenceOpenedHeight - 2*panelHeight
310+ maxTotalDragDistance: openedHeight - panelHeight
336 distanceThreshold: 0
311 distanceThreshold: 0