@@ -22,7 +22,7 @@ import "../Components/ListItems"
2222
2323Item {
2424 id: root
25− readonly property real panelHeight: nonIndicatorArea.y + nonIndicatorArea.height
25+ readonly property real panelHeight: indicatorArea.y + d.indicatorHeight
2626 property alias indicators: __indicators
2727 property alias callHint: __callHint
2828 property bool fullscreenMode: false
@@ -56,9 +56,10 @@ Item {
5656 id: darkenedArea
5757 property real darkenedOpacity: 0.6
5858 anchors {
59+ top: parent.top
60+ topMargin: panelHeight
5961 left: parent.left
6062 right: parent.right
61− top: nonIndicatorArea.bottom
6263 bottom: parent.bottom
6364 }
6465 color: "black"
@@ -71,60 +72,11 @@ Item {
7172 }
7273 }
7374
74− PanelBackground {
75− anchors.fill: nonIndicatorArea
76− }
77−
78− Item {
79− id: nonIndicatorArea
80− objectName: "indicatorArea"
81−
82− anchors {
83− top: callHint.bottom
84− left: parent.left
85− right: parent.right
86− }
87− height: d.indicatorHeight
88−
89− PanelSeparatorLine {
90− id: leftSeparatorLine
91− anchors {
92− bottom: parent.bottom
93− left: parent.left
94− right: parent.right
95− }
96− saturation: 1 - indicators.unitProgress
97− }
98−
99− MouseArea {
100− id: nonIndicatorMouseArea
101− enabled: callHint.active
102− anchors {
103− top: parent.top
104− left: parent.left
105− right: parent.right
106− }
107− height: indicators.panelHeight/2
108− onClicked: callHint.activate();
109− }
110− }
111−
112− // eater
113− MouseArea {
114− anchors.fill: callHint
115− onClicked: callHint.activate()
116− }
117−
11875 Item {
11976 id: indicatorArea
12077 objectName: "indicatorArea"
12178
122− anchors {
123− top: callHint.bottom
124− right: parent.right
125− bottom: parent.bottom
126− }
127− width: indicators.width
79+ anchors.fill: parent
12880
12981 Behavior on anchors.topMargin { StandardAnimation {} }
13082
@@ -146,15 +98,34 @@ Item {
14698 bottom: indicators.bottom
14799 right: indicators.left
148100
149− topMargin: nonIndicatorArea.anchors.topMargin + indicators.panelHeight
101+ topMargin: indicatorArea.anchors.topMargin + indicators.panelHeight
150102 }
151103
152104 width: units.dp(2)
153105 source: "graphics/VerticalDivider.png"
154106 }
155107
156− PanelBackground {
157− anchors.fill: indicators
108+ Rectangle {
109+ id: indicatorAreaBackground
110+ color: callHint.visible ? "green" : "black"
111+ anchors {
112+ top: parent.top
113+ left: parent.left
114+ right: parent.right
115+ }
116+ height: indicators.panelHeight
117+
118+ Behavior on color { ColorAnimation { duration: UbuntuAnimation.FastDuration } }
119+ }
120+
121+ PanelSeparatorLine {
122+ id: nonIndicatorAreaSeparatorLine
123+ anchors {
124+ top: indicatorAreaBackground.bottom
125+ left: parent.left
126+ right: indicators.left
127+ }
128+ saturation: 1 - indicators.unitProgress
158129 }
159130
160131 Indicators {
@@ -169,91 +140,80 @@ Item {
169140 width: (root.width > units.gu(60)) ? units.gu(40) : root.width
170141 shown: false
171142 panelHeight: units.gu(3)
172− openedHeight: root.height - (callHint.y + callHint.height)
173− overFlowWidth: search.state=="hidden" ? root.width : root.width - search.width
143+ openedHeight: root.height
144+ overFlowWidth: {
145+ if (callHint.visible) {
146+ return Math.max(root.width - (callHint.width + units.gu(2)), 0)
147+ }
148+ return search.state=="hidden" ? root.width : root.width - search.width
149+ }
174150
175151 enableHint: !callHint.active && !fullscreenMode
176152 showHintBottomMargin: fullscreenMode ? -panelHeight : 0
177− showHintHeightOffset: callHint.active ? callHint.height : 0
178153
179154 onShowTapped: {
180155 if (callHint.active) {
181− var callHintScenePosition = callHint.mapToItem(null, callHint.x, callHint.y);
182− var indicatorScenePosition = mapToItem(null, x, y);
183−
184− // tapped on callHint
185− if (position.y > callHintScenePosition.y && position.y <= callHintScenePosition.y + callHint.height) {
186− callHint.activate();
187− // tapped on top half of indicator
188− } else if (!fullscreenMode && position.y > indicatorScenePosition.y && position.y < indicatorScenePosition.y + panelHeight/2) {
189− callHint.activate();
190− }
156+ callHint.activate();
191157 }
192158 }
193159 }
194160
195− PanelSeparatorLine {
196− id: indicatorsSeparatorLine
197− visible: true
198− anchors {
199− top: indicators.bottom
200− left: indicatorDividor.left
201− right: indicators.right
202− }
203− }
204− }
205−
206− SearchIndicator {
207− id: search
208− objectName: "search"
209− enabled: root.searchVisible
161+ SearchIndicator {
162+ id: search
163+ objectName: "search"
164+ enabled: root.searchVisible
210165
211− state: {
212− if (parent.width < indicators.width + width) {
213− if (indicators.state != "initial") {
214− return "hidden";
166+ state: {
167+ if (callHint.visible) {
168+ return "hidden"
169+ }
170+ if (parent.width < indicators.width + width) {
171+ if (indicators.state != "initial") {
172+ return "hidden";
173+ }
174+ }
175+ if (root.searchVisible && !indicators.showAll) {
176+ return "visible";
215177 }
178+ return "hidden";
216179 }
217− if (root.searchVisible && !indicators.showAll) {
218− return "visible";
180+ anchors {
181+ top: parent.top
182+ left: parent.left
219183 }
220− return "hidden";
221− }
184+ height: indicators.panelHeight
222185
223− anchors {
224− top: nonIndicatorArea.top
225− bottom: nonIndicatorArea.bottom
226− left: nonIndicatorArea.left
186+ mouseArea {
187+ onClicked: root.searchClicked()
188+ }
227189 }
228190
229− mouseArea {
230− onClicked: root.searchClicked()
231− }
232− }
191+ ActiveCallHint {
192+ id: __callHint
193+ anchors {
194+ top: parent.top
195+ left: parent.left
196+ }
197+ height: indicators.panelHeight
198+ visible: active && indicators.state == "initial"
233199
234− ActiveCallHint {
235− id: __callHint
236− anchors {
237− left: parent.left
238− right: parent.right
200+ Component.onCompleted: console.log("callHint " + width)
239201 }
240− height: units.gu(3)
241− y: -height
242202
243− states: [
244− State {
245− name: "active"
246− when: callHint.active
247− PropertyChanges { target: callHint; y: 0 }
248− PropertyChanges { target: search.mouseArea; anchors.topMargin: -callHint.height/3 }
203+ PanelSeparatorLine {
204+ id: indicatorsSeparatorLine
205+ visible: true
206+ anchors {
207+ top: indicators.bottom
208+ left: indicatorDividor.left
209+ right: indicators.right
249210 }
250− ]
251− Behavior on y { StandardAnimation {} }
211+ }
252212 }
253213
254214 QtObject {
255215 id: d
256− readonly property real indicatorHeight: indicators.panelHeight + leftSeparatorLine.height
216+ readonly property real indicatorHeight: indicators.panelHeight + indicatorsSeparatorLine.height
257217 }
258218
259219 states: [
@@ -264,33 +224,7 @@ Item {
264224 State {
265225 name: "offscreen" //pushed off screen
266226 when: fullscreenMode
267− PropertyChanges { target: nonIndicatorArea; anchors.topMargin: -d.indicatorHeight }
268227 PropertyChanges { target: indicatorArea; anchors.topMargin: indicators.state === "initial" ? -d.indicatorHeight : 0 }
269228 }
270229 ]
271−
272− transitions: [
273− Transition {
274− to: "onscreen"
275− SequentialAnimation {
276− ParallelAnimation {
277− StandardAnimation { target: nonIndicatorArea; property: "anchors.topMargin" }
278− StandardAnimation { target: indicatorArea; property: "anchors.topMargin" }
279− }
280− PropertyAction { target: search; property: "z"; value: 2 }
281− PropertyAction { target: indicatorArea; property: "z"; value: 2 }
282− }
283− },
284− Transition {
285− to: "offscreen"
286− SequentialAnimation {
287− PropertyAction { target: search; property: "z"; value: 0 }
288− PropertyAction { target: indicatorArea; property: "z"; value: 0 }
289− ParallelAnimation {
290− StandardAnimation { target: nonIndicatorArea; property: "anchors.topMargin" }
291− StandardAnimation { target: indicatorArea; property: "anchors.topMargin" }
292− }
293− }
294− }
295− ]
296230}