on xenial help sign in
Made panel heights a bit more easy to understand.
3673b8aNick Dedekind
Panel/Indicators.qml+17−42
@@ -25,14 +25,12 @@ import "../Components/Math.js" as MathLocal
25Showable {
25Showable {
26 id: indicators
26 id: indicators
27
27
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
33
31
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
38
36
@@ -56,18 +54,20 @@ Showable {
56
54
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";
67 }
67 }
68 }
68 }
69
69
70− if (contentProgress == 0) {
70+ if (revealProgress == 0) {
71 menuContent.releaseContent();
71 menuContent.releaseContent();
72 }
72 }
73 }
73 }
@@ -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
159 }
159 }
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
192 }
192 }
193 height: get_height()
193 height: get_height()
194 clip: height < handleImage.height
194 clip: height < handleImage.height
@@ -212,33 +212,14 @@ Showable {
212 }
212 }
213 }
213 }
214
214
215− PanelSeparatorLine {
216− id: indicatorsSeparatorLine
217− visible: true
218− anchors {
219− top: handle.bottom
220− left: indicators.left
221− right: indicators.right
222− }
223− }
224−
225− BorderImage {
226− id: dropShadow
227− anchors {
228− top: indicators.top
229− bottom: indicatorsSeparatorLine.bottom
230− left: indicators.left
231− right: indicators.right
232− margins: -units.gu(1)
233− }
234− visible: indicators.height > panelHeight
235− source: "graphics/rectangular_dropshadow.sci"
236− }
237−
238 PanelBackground {
215 PanelBackground {
239 anchors.fill: indicatorRow
216 anchors.fill: indicatorRow
240 }
217 }
241
218
219+ IndicatorsDataModel {
220+ id: indicatorsModel
221+ }
222+
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
252
233
253 onCurrentItemIndexChanged: menuContent.currentIndex = currentItemIndex
234 onCurrentItemIndexChanged: menuContent.currentIndex = currentItemIndex
254−
255− }
256−
257− IndicatorsDataModel {
258− id: indicatorsModel
259 }
235 }
260
236
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)
319
295
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
329− height: panelHeight
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
337 }
312 }
338
313
Panel/Panel.qml+25−4
@@ -39,7 +39,6 @@ Item {
39 }
39 }
40 height: __panelMinusSeparatorLineHeight
40 height: __panelMinusSeparatorLineHeight
41 y: 0
41 y: 0
42− onYChanged: indicatorsMenu.y = y;
43
42
44 Behavior on y { StandardAnimation {} }
43 Behavior on y { StandardAnimation {} }
45 }
44 }
@@ -76,18 +75,40 @@ Item {
76 id: indicatorsMenu
75 id: indicatorsMenu
77
76
78 anchors.right: parent.right
77 anchors.right: parent.right
79− y: 0
78+ y: panelBackground.y
80 width: root.indicatorsMenuWidth
79 width: root.indicatorsMenuWidth
81 shown: false
80 shown: false
82 hintValue: __panelMinusSeparatorLineHeight * 3
81 hintValue: __panelMinusSeparatorLineHeight * 3
83 panelHeight: __panelMinusSeparatorLineHeight
82 panelHeight: __panelMinusSeparatorLineHeight
84− referenceOpenedHeight: parent.height
83+ openedHeight: parent.height + (pinnedMode ? 0 : root.panelHeight)
85−
86 pinnedMode: !fullscreenMode
84 pinnedMode: !fullscreenMode
87
85
88 property real unitProgress: (height - panelHeight) / (openedHeight - panelHeight)
86 property real unitProgress: (height - panelHeight) / (openedHeight - panelHeight)
89 }
87 }
90
88
89+ PanelSeparatorLine {
90+ id: indicatorsSeparatorLine
91+ visible: true
92+ anchors {
93+ top: indicatorsMenu.bottom
94+ left: indicatorsMenu.left
95+ right: indicatorsMenu.right
96+ }
97+ }
98+
99+ BorderImage {
100+ id: dropShadow
101+ anchors {
102+ top: indicators.top
103+ bottom: indicatorsSeparatorLine.bottom
104+ left: indicators.left
105+ right: indicators.right
106+ margins: -units.gu(1)
107+ }
108+ visible: indicatorsMenu.height > indicatorsMenu.panelHeight
109+ source: "graphics/rectangular_dropshadow.sci"
110+ }
111+
91 SearchIndicator {
112 SearchIndicator {
92 id: search
113 id: search
93 objectName: "search"
114 objectName: "search"