on xenial help sign in
panelState fixes
e88688eNick Dedekind
tests/qmltests/ApplicationMenus/tst_MenuBar.qml+2
@@ -24,6 +24,7 @@ import Unity.Test 0.1
24import Utils 0.1
24import Utils 0.1
25
25
26import "../../../qml/ApplicationMenus"
26import "../../../qml/ApplicationMenus"
27+import "../../../qml/Components/PanelState"
27import ".."
28import ".."
28
29
29Item {
30Item {
@@ -67,6 +68,7 @@ Item {
67 id: menuBackend
68 id: menuBackend
68 modelData: appMenuData.generateTestData(10,5,2,3)
69 modelData: appMenuData.generateTestData(10,5,2,3)
69 }
70 }
71+ panelState: PanelState {}
70 }
72 }
71 }
73 }
72
74
tests/qmltests/ApplicationMenus/tst_MenuPopup.qml+2
@@ -24,6 +24,7 @@ import Unity.Test 0.1
24import Utils 0.1
24import Utils 0.1
25
25
26import "../../../qml/ApplicationMenus"
26import "../../../qml/ApplicationMenus"
27+import "../../../qml/Components/PanelState"
27import ".."
28import ".."
28
29
29Item {
30Item {
@@ -59,6 +60,7 @@ Item {
59 }}
60 }}
60 ]
61 ]
61 }
62 }
63+ panelState: PanelState {}
62 }
64 }
63 }
65 }
64
66
tests/qmltests/Panel/tst_Panel.qml+4−2
@@ -101,6 +101,8 @@ PanelTest {
101 model: root.indicatorsModel
101 model: root.indicatorsModel
102 hides: [ panel.applicationMenus ]
102 hides: [ panel.applicationMenus ]
103 }
103 }
104+
105+ panelState: PanelState {}
104 }
106 }
105 }
107 }
106 }
108 }
@@ -857,7 +859,7 @@ PanelTest {
857
859
858 var indicatorsBar = findChild(panel.applicationMenus, "indicatorsBar");
860 var indicatorsBar = findChild(panel.applicationMenus, "indicatorsBar");
859
861
860− PanelState.title = "Fake Title"
862+ panelState.title = "Fake Title"
861 pullDownApplicationsMenu(0 /*xPos*/);
863 pullDownApplicationsMenu(0 /*xPos*/);
862 compare(aboutToShowCalledSpy.count, 1);
864 compare(aboutToShowCalledSpy.count, 1);
863
865
@@ -890,7 +892,7 @@ PanelTest {
890
892
891 var indicatorsBar = findChild(panel.applicationMenus, "indicatorsBar");
893 var indicatorsBar = findChild(panel.applicationMenus, "indicatorsBar");
892
894
893− PanelState.title = "Fake Title"
895+ panelState.title = "Fake Title"
894 pullDownApplicationsMenu(0 /*xPos*/);
896 pullDownApplicationsMenu(0 /*xPos*/);
895
897
896 tryCompare(indicatorsBar, "currentItemIndex", 0);
898 tryCompare(indicatorsBar, "currentItemIndex", 0);
tests/qmltests/tst_Shell.qml+7−8
@@ -38,7 +38,6 @@ import Unity.Indicators 0.1 as Indicators
38
38
39import "../../qml"
39import "../../qml"
40import "../../qml/Components"
40import "../../qml/Components"
41−import "../../qml/Components/PanelState"
42import "Stage"
41import "Stage"
43
42
44Rectangle {
43Rectangle {
@@ -66,12 +65,12 @@ Rectangle {
66 } else {
65 } else {
67 topLevelSurfaceList = null;
66 topLevelSurfaceList = null;
68 appMenuData.surfaceManager = null;
67 appMenuData.surfaceManager = null;
69− panelState = undefined;
68+ panelState = null;
70 }
69 }
71 }
70 }
72
71
73 property var topLevelSurfaceList: null
72 property var topLevelSurfaceList: null
74− property var panelState: undefined
73+ property var panelState: null
75
74
76 QtObject {
75 QtObject {
77 id: _screenWindow
76 id: _screenWindow
@@ -2666,9 +2665,9 @@ Rectangle {
2666
2665
2667 function test_oskDisplacesWindow_data() {
2666 function test_oskDisplacesWindow_data() {
2668 return [
2667 return [
2669− {tag: "no need to displace", windowHeight: units.gu(10), windowY: units.gu(5), targetDisplacement: units.gu(5), oskEnabled: true},
2668+ {tag: "no need to displace", windowHeight: units.gu(10), windowY: units.gu(5), targetDisplacement: function() { return units.gu(5); }, oskEnabled: true},
2670− {tag: "displace to top", windowHeight: units.gu(50), windowY: units.gu(10), targetDisplacement: panelState.panelHeight, oskEnabled: true},
2669+ {tag: "displace to top", windowHeight: units.gu(50), windowY: units.gu(10), targetDisplacement: function() { return panelState.panelHeight; }, oskEnabled: true},
2671− {tag: "osk not on this screen", windowHeight: units.gu(40), windowY: units.gu(10), targetDisplacement: units.gu(10), oskEnabled: false},
2670+ {tag: "osk not on this screen", windowHeight: units.gu(40), windowY: units.gu(10), targetDisplacement: function() { return units.gu(10); }, oskEnabled: false},
2672 ]
2671 ]
2673 }
2672 }
2674
2673
@@ -2694,7 +2693,7 @@ Rectangle {
2694 verify(initialY > panelState.panelHeight);
2693 verify(initialY > panelState.panelHeight);
2695
2694
2696 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, root.height / 2, root.width, root.height / 2));
2695 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, root.height / 2, root.width, root.height / 2));
2697− tryCompare(dashAppDelegate, "y", data.targetDisplacement);
2696+ tryCompare(dashAppDelegate, "y", data.targetDisplacement());
2698
2697
2699 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, 0, 0, 0));
2698 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, 0, 0, 0));
2700 tryCompare(dashAppDelegate, "y", initialY);
2699 tryCompare(dashAppDelegate, "y", initialY);
@@ -3127,7 +3126,7 @@ Rectangle {
3127 // double click the panel
3126 // double click the panel
3128 var panel = findChild(shell, "panel");
3127 var panel = findChild(shell, "panel");
3129 verify(panel);
3128 verify(panel);
3130− mouseDoubleClickSequence(panel, panel.width/2, PanelState.panelHeight/2, Qt.LeftButton, Qt.NoModifier, 300);
3129+ mouseDoubleClickSequence(panel, panel.width/2, panelState.panelHeight/2, Qt.LeftButton, Qt.NoModifier, 300);
3131 tryCompare(appDelegate, "state", "restored");
3130 tryCompare(appDelegate, "state", "restored");
3132 }
3131 }
3133
3132