on xenial help sign in
make testDesktopStage work again
commit58e65b82e1753b1ab4e47a6c345f5a7d6371d67d authorMichael Zanetti <michael.zanetti@canonical.com> dateThu 23 Mar 2017, 11:25 (10 years ago) parent2317308
6 files changed+12−5
qml/ApplicationMenus/MenuBar.qml+2−1 qml/ApplicationMenus/MenuPopup.qml+3−1 qml/Panel/Panel.qml+1 qml/Stage/DecoratedWindow.qml+1 qml/Stage/WindowDecoration.qml+2 tests/qmltests/Stage/tst_DesktopStage.qml+3−3
qml/ApplicationMenus/MenuBar.qml+2−1
@@ -29,6 +29,7 @@ Item {
2929 property bool enableKeyFilter: false
3030 property real overflowWidth: width
3131 property bool windowMoving: false
32+ property var panelState: null
3233
3334 // read from outside
3435 readonly property bool valid: rowRepeater.count > 0
@@ -106,7 +107,7 @@ Item {
106107
107108 Component {
108109 id: menuComponent
109− MenuPopup { }
110+ MenuPopup { panelState: root.panelState }
110111 }
111112
112113 Repeater {
qml/ApplicationMenus/MenuPopup.qml+3−1
@@ -26,6 +26,7 @@ UbuntuShape {
2626 id: root
2727 objectName: "menu"
2828 backgroundColor: theme.palette.normal.overlay
29+ property PanelState panelState
2930
3031 signal childActivated()
3132
@@ -101,7 +102,7 @@ UbuntuShape {
101102 property real __minimumWidth: units.gu(20)
102103 property real __maximumWidth: ApplicationMenusLimits.screenWidth * 0.7
103104 property real __minimumHeight: units.gu(2)
104− property real __maximumHeight: ApplicationMenusLimits.screenHeight - PanelState.panelHeight
105+ property real __maximumHeight: ApplicationMenusLimits.screenHeight - panelState.panelHeight
105106
106107 signal dismissAll()
107108
@@ -476,6 +477,7 @@ UbuntuShape {
476477 item.desiredX = Qt.binding(function() { return submenuLoader.desiredX; });
477478 item.desiredY = Qt.binding(function() { return submenuLoader.desiredY; });
478479 item.substractWidth = Qt.binding(function() { return submenuLoader.substractWidth; });
480+ item.panelState = Qt.binding(function() { return root.panelState; });
479481 }
480482
481483 Keys.onLeftPressed: retreat()
qml/Panel/Panel.qml+1
@@ -220,6 +220,7 @@ Item {
220220 height: menuBarLoader.height
221221 enableKeyFilter: valid && panelState.decorationsVisible
222222 unityMenuModel: __applicationMenus.model
223+ panelState: root.panelState
223224
224225 Connections {
225226 target: __applicationMenus
qml/Stage/DecoratedWindow.qml+1
@@ -211,6 +211,7 @@ FocusScope {
211211
212212 title: applicationWindow.title
213213 windowMoving: moveHandler.moving && !altDragHandler.dragging
214+ panelState: root.panelState
214215
215216 opacity: root.hasDecoration ? Math.min(1, root.showDecoration) : 0
216217 Behavior on opacity { UbuntuNumberAnimation { } }
qml/Stage/WindowDecoration.qml+2
@@ -34,6 +34,7 @@ MouseArea {
3434 property var menu: undefined
3535 property bool enableMenus: true
3636 property bool windowMoving: false
37+ property PanelState panelState
3738
3839 readonly property real buttonsWidth: buttons.width + row.spacing
3940
@@ -146,6 +147,7 @@ MouseArea {
146147 enableKeyFilter: valid && root.active && root.enableMenus
147148 unityMenuModel: root.menu
148149 windowMoving: root.windowMoving
150+ panelState: root.panelState
149151
150152 onPressed: root.onPressed(mouse)
151153 onPressedChangedEx: root.pressedChangedEx(pressed, pressedButtons, mouseX, mouseY)
tests/qmltests/Stage/tst_DesktopStage.qml+3−3
@@ -630,19 +630,19 @@ Item {
630630 maximizeDelegate(facebookAppDelegate);
631631
632632 // verify the drop shadow is still not visible
633− verify(panelState.dropShadow == false);
633+ verify(panelStateObj.dropShadow == false);
634634
635635 // start a foreground app, not maximized
636636 var dialerAppDelegate = startApplication("dialer-app");
637637
638638 // verify the drop shadow becomes visible
639− tryCompareFunction(function() { return panelState.dropShadow; }, true);
639+ tryCompareFunction(function() { return panelStateObj.dropShadow; }, true);
640640
641641 // close the maximized app
642642 ApplicationManager.stopApplication("facebook-webapp");
643643
644644 // verify the drop shadow is gone
645− tryCompare(panelState, "dropShadow", false);
645+ tryCompare(panelStateObj, "dropShadow", false);
646646 }
647647
648648 function test_threeFingerTapShowsWindowControls_data() {