on xenial help sign in
fixed tests
commitb2d121a7711e97df1fffae75bd4a44e66715f810 authorNick Dedekind <nicholas.dedekind@gmail.com> dateMon 23 Jun 2014, 17:33 (12 years ago) parent7b084d9
4 files changed+33−28
qml/Panel/ActiveCallHint.qml+1−6 qml/Panel/Panel.qml+11 tests/qmltests/Panel/tst_ActiveCallHint.qml+2−2 tests/qmltests/Panel/tst_Panel.qml+19−20
qml/Panel/ActiveCallHint.qml+1−6
@@ -33,12 +33,7 @@ Item {
3333 }
3434
3535 function activate() {
36− ApplicationManager.requestFocusApplication("dialer-app");
37− }
38−
39− MouseArea {
40− anchors.fill: parent
41− onClicked: activate()
36+ Qt.openUrlExternally("dialer:///?view=liveCall");
4237 }
4338
4439 Component {
qml/Panel/Panel.qml+11
@@ -128,6 +128,17 @@ Item {
128128 saturation: 1 - indicators.unitProgress
129129 }
130130
131+ MouseArea {
132+ anchors {
133+ top: parent.top
134+ left: parent.left
135+ right: indicators.left
136+ }
137+ height: indicators.panelHeight
138+ enabled: callHint.visible
139+ onClicked: callHint.activate()
140+ }
141+
131142 Indicators {
132143 id: __indicators
133144 objectName: "indicators"
tests/qmltests/Panel/tst_ActiveCallHint.qml+2−2
@@ -48,7 +48,7 @@ Item {
4848 right:parent.right
4949 }
5050 height: units.gu(3)
51− alternateLabelInterval: 2000
51+ labelSwitchInterval: 2000
5252 }
5353
5454 Component.onCompleted: {
@@ -67,7 +67,7 @@ Item {
6767 function init() {
6868 callManager.foregroundCall = null;
6969 callManager.backgroundCall = null;
70− callHint.alternateLabelInterval = 300;
70+ callHint.labelSwitchInterval = 300;
7171 }
7272
7373 function test_activeHint_data() {
tests/qmltests/Panel/tst_Panel.qml+19−20
@@ -59,6 +59,10 @@ Item {
5959 onSearchClicked: console.log("Search Clicked")
6060
6161 property real panelAndSeparatorHeight: panel.indicators.panelHeight + units.dp(2)
62+
63+ Component.onCompleted: {
64+ callManager.foregroundCall = phoneCall;
65+ }
6266 }
6367
6468
@@ -108,11 +112,10 @@ Item {
108112 width: parent.width/3
109113
110114 onClicked: {
111− if (callManager.hasCalls) {
112− callManager.foregroundCall = null;
113− callManager.backgroundCall = null;
115+ if (callManager.callIndicatorVisible) {
116+ callManager.callIndicatorVisible = false;
114117 } else {
115− callManager.foregroundCall = phoneCall;
118+ callManager.callIndicatorVisible = true;
116119 }
117120 }
118121 }
@@ -135,7 +138,7 @@ Item {
135138 panel.indicators.hide();
136139 // Wait for animation to complete
137140 tryCompare(panel.indicators.hideAnimation, "running", false);
138− callManager.foregroundCall = null;
141+ callManager.callIndicatorVisible = false;
139142
140143 // Wait for the indicators to get into position.
141144 // (switches between normal and fullscreen modes are animated)
@@ -206,11 +209,7 @@ Item {
206209 // Pressing on the top edge of the indicator should have no effect if the panel
207210 // has an active call
208211 function test_noHintOnActiveCall() {
209− callManager.foregroundCall = phoneCall;
210− // Wait for the indicators to get into position.
211− // (switches between normal and fullscreen modes are animated)
212− var indicatorArea = findChild(panel, "indicatorArea");
213− tryCompare(indicatorArea, "y", panel.callHint.height);
212+ callManager.callIndicatorVisible = true;
214213
215214 var indicatorItemCoord = get_indicator_item_position(0);
216215
@@ -231,18 +230,18 @@ Item {
231230
232231 function test_drag_show_data() {
233232 return [
234− { tag: "pinned", fullscreenFlag: false, alreadyOpen: false, call: null,
233+ { tag: "pinned", fullscreenFlag: false, alreadyOpen: false, call: false,
235234 indicatorY: function() { return 0 } },
236− { tag: "fullscreen", fullscreenFlag: true, alreadyOpen: false, call: null,
235+ { tag: "fullscreen", fullscreenFlag: true, alreadyOpen: false, call: false,
237236 indicatorY: function() {return -panel.panelAndSeparatorHeight } },
238− { tag: "pinned-alreadyOpen", fullscreenFlag: false, alreadyOpen: true, call: null,
237+ { tag: "pinned-alreadyOpen", fullscreenFlag: false, alreadyOpen: true, call: false,
239238 indicatorY: function() { return 0 } },
240− { tag: "fullscreen-alreadyOpen", fullscreenFlag: true, alreadyOpen: true, call: null,
241− indicatorY: function() {return -panel.panelAndSeparatorHeight } },
242− { tag: "pinned-callActive", fullscreenFlag: false, alreadyOpen: false, call: phoneCall,
243− indicatorY: function() { return panel.callHint.height } },
244− { tag: "fullscreen-callActive", fullscreenFlag: true, alreadyOpen: false, call: phoneCall,
245− indicatorY: function() { return panel.callHint.height - panel.panelAndSeparatorHeight } }
239+ { tag: "fullscreen-alreadyOpen", fullscreenFlag: true, alreadyOpen: true, call: false,
240+ indicatorY: function() {return 0 } },
241+ { tag: "pinned-callActive", fullscreenFlag: false, alreadyOpen: false, call: true,
242+ indicatorY: function() { return 0 } },
243+ { tag: "fullscreen-callActive", fullscreenFlag: true, alreadyOpen: false, call: true,
244+ indicatorY: function() { return -panel.panelAndSeparatorHeight } }
246245 ];
247246 }
248247
@@ -251,7 +250,7 @@ Item {
251250 // expose more of the panel, binding it to the selected indicator and opening it's menu.
252251 function test_drag_show(data) {
253252 panel.fullscreenMode = data.fullscreenFlag;
254− callManager.foregroundCall = data.call;
253+ callManager.callIndicatorVisible = data.call;
255254
256255 if (data.alreadyOpen) {
257256 panel.indicators.show();