on xenial help sign in
make testDesktopStage work again
58e65b8Michael Zanetti
qml/ApplicationMenus/MenuBar.qml+2−1
@@ -29,6 +29,7 @@ Item {
29 property bool enableKeyFilter: false
29 property bool enableKeyFilter: false
30 property real overflowWidth: width
30 property real overflowWidth: width
31 property bool windowMoving: false
31 property bool windowMoving: false
32+ property var panelState: null
32
33
33 // read from outside
34 // read from outside
34 readonly property bool valid: rowRepeater.count > 0
35 readonly property bool valid: rowRepeater.count > 0
@@ -106,7 +107,7 @@ Item {
106
107
107 Component {
108 Component {
108 id: menuComponent
109 id: menuComponent
109− MenuPopup { }
110+ MenuPopup { panelState: root.panelState }
110 }
111 }
111
112
112 Repeater {
113 Repeater {
qml/ApplicationMenus/MenuPopup.qml+3−1
@@ -26,6 +26,7 @@ UbuntuShape {
26 id: root
26 id: root
27 objectName: "menu"
27 objectName: "menu"
28 backgroundColor: theme.palette.normal.overlay
28 backgroundColor: theme.palette.normal.overlay
29+ property PanelState panelState
29
30
30 signal childActivated()
31 signal childActivated()
31
32
@@ -101,7 +102,7 @@ UbuntuShape {
101 property real __minimumWidth: units.gu(20)
102 property real __minimumWidth: units.gu(20)
102 property real __maximumWidth: ApplicationMenusLimits.screenWidth * 0.7
103 property real __maximumWidth: ApplicationMenusLimits.screenWidth * 0.7
103 property real __minimumHeight: units.gu(2)
104 property real __minimumHeight: units.gu(2)
104− property real __maximumHeight: ApplicationMenusLimits.screenHeight - PanelState.panelHeight
105+ property real __maximumHeight: ApplicationMenusLimits.screenHeight - panelState.panelHeight
105
106
106 signal dismissAll()
107 signal dismissAll()
107
108
@@ -476,6 +477,7 @@ UbuntuShape {
476 item.desiredX = Qt.binding(function() { return submenuLoader.desiredX; });
477 item.desiredX = Qt.binding(function() { return submenuLoader.desiredX; });
477 item.desiredY = Qt.binding(function() { return submenuLoader.desiredY; });
478 item.desiredY = Qt.binding(function() { return submenuLoader.desiredY; });
478 item.substractWidth = Qt.binding(function() { return submenuLoader.substractWidth; });
479 item.substractWidth = Qt.binding(function() { return submenuLoader.substractWidth; });
480+ item.panelState = Qt.binding(function() { return root.panelState; });
479 }
481 }
480
482
481 Keys.onLeftPressed: retreat()
483 Keys.onLeftPressed: retreat()
qml/Panel/Panel.qml+1
@@ -220,6 +220,7 @@ Item {
220 height: menuBarLoader.height
220 height: menuBarLoader.height
221 enableKeyFilter: valid && panelState.decorationsVisible
221 enableKeyFilter: valid && panelState.decorationsVisible
222 unityMenuModel: __applicationMenus.model
222 unityMenuModel: __applicationMenus.model
223+ panelState: root.panelState
223
224
224 Connections {
225 Connections {
225 target: __applicationMenus
226 target: __applicationMenus
qml/Stage/DecoratedWindow.qml+1
@@ -211,6 +211,7 @@ FocusScope {
211
211
212 title: applicationWindow.title
212 title: applicationWindow.title
213 windowMoving: moveHandler.moving && !altDragHandler.dragging
213 windowMoving: moveHandler.moving && !altDragHandler.dragging
214+ panelState: root.panelState
214
215
215 opacity: root.hasDecoration ? Math.min(1, root.showDecoration) : 0
216 opacity: root.hasDecoration ? Math.min(1, root.showDecoration) : 0
216 Behavior on opacity { UbuntuNumberAnimation { } }
217 Behavior on opacity { UbuntuNumberAnimation { } }
qml/Stage/WindowDecoration.qml+2
@@ -34,6 +34,7 @@ MouseArea {
34 property var menu: undefined
34 property var menu: undefined
35 property bool enableMenus: true
35 property bool enableMenus: true
36 property bool windowMoving: false
36 property bool windowMoving: false
37+ property PanelState panelState
37
38
38 readonly property real buttonsWidth: buttons.width + row.spacing
39 readonly property real buttonsWidth: buttons.width + row.spacing
39
40
@@ -146,6 +147,7 @@ MouseArea {
146 enableKeyFilter: valid && root.active && root.enableMenus
147 enableKeyFilter: valid && root.active && root.enableMenus
147 unityMenuModel: root.menu
148 unityMenuModel: root.menu
148 windowMoving: root.windowMoving
149 windowMoving: root.windowMoving
150+ panelState: root.panelState
149
151
150 onPressed: root.onPressed(mouse)
152 onPressed: root.onPressed(mouse)
151 onPressedChangedEx: root.pressedChangedEx(pressed, pressedButtons, mouseX, mouseY)
153 onPressedChangedEx: root.pressedChangedEx(pressed, pressedButtons, mouseX, mouseY)
tests/qmltests/Stage/tst_DesktopStage.qml+3−3
@@ -630,19 +630,19 @@ Item {
630 maximizeDelegate(facebookAppDelegate);
630 maximizeDelegate(facebookAppDelegate);
631
631
632 // verify the drop shadow is still not visible
632 // verify the drop shadow is still not visible
633− verify(panelState.dropShadow == false);
633+ verify(panelStateObj.dropShadow == false);
634
634
635 // start a foreground app, not maximized
635 // start a foreground app, not maximized
636 var dialerAppDelegate = startApplication("dialer-app");
636 var dialerAppDelegate = startApplication("dialer-app");
637
637
638 // verify the drop shadow becomes visible
638 // verify the drop shadow becomes visible
639− tryCompareFunction(function() { return panelState.dropShadow; }, true);
639+ tryCompareFunction(function() { return panelStateObj.dropShadow; }, true);
640
640
641 // close the maximized app
641 // close the maximized app
642 ApplicationManager.stopApplication("facebook-webapp");
642 ApplicationManager.stopApplication("facebook-webapp");
643
643
644 // verify the drop shadow is gone
644 // verify the drop shadow is gone
645− tryCompare(panelState, "dropShadow", false);
645+ tryCompare(panelStateObj, "dropShadow", false);
646 }
646 }
647
647
648 function test_threeFingerTapShowsWindowControls_data() {
648 function test_threeFingerTapShowsWindowControls_data() {