on xenial help sign in
feature parity: with a maximized window, "dragging" the panel down should restore it
6fe702eLukáš Tinkl
qml/Panel/Panel.qml+10
@@ -101,6 +101,7 @@ Item {
101 }
101 }
102
102
103 MouseArea {
103 MouseArea {
104+ objectName: "windowControlArea"
104 anchors {
105 anchors {
105 top: parent.top
106 top: parent.top
106 left: parent.left
107 left: parent.left
@@ -111,6 +112,15 @@ Item {
111 onClicked: callHint.visible ? callHint.showLiveCall() : PanelState.focusMaximizedApp()
112 onClicked: callHint.visible ? callHint.showLiveCall() : PanelState.focusMaximizedApp()
112 onDoubleClicked: PanelState.maximize()
113 onDoubleClicked: PanelState.maximize()
113
114
115+ property bool mouseWasPressed: false
116+ onPressed: mouseWasPressed = containsPress
117+ onExited: {
118+ if (mouseWasPressed && !indicatorAreaBackground.contains(Qt.point(mouseX, mouseY))) {
119+ PanelState.maximize(); // restore the window when "dragging" the panel down
120+ mouseWasPressed = false;
121+ }
122+ }
123+
114 // WindowControlButtons inside the mouse area, otherwise QML doesn't grok nested hover events :/
124 // WindowControlButtons inside the mouse area, otherwise QML doesn't grok nested hover events :/
115 // cf. https://bugreports.qt.io/browse/QTBUG-32909
125 // cf. https://bugreports.qt.io/browse/QTBUG-32909
116 WindowControlButtons {
126 WindowControlButtons {
tests/qmltests/tst_Shell.qml+24
@@ -2345,5 +2345,29 @@ Rectangle {
2345 tryCompare(app2.session.lastSurface, "keymapLayout", "fr");
2345 tryCompare(app2.session.lastSurface, "keymapLayout", "fr");
2346 tryCompare(app2.session.lastSurface, "keymapVariant", "");
2346 tryCompare(app2.session.lastSurface, "keymapVariant", "");
2347 }
2347 }
2348+
2349+ function test_dragPanelToRestoreMaximizedWindow() {
2350+ loadShell("desktop");
2351+ shell.usageScenario = "desktop";
2352+ waitForRendering(shell);
2353+ var panel = findChild(shell, "windowControlArea");
2354+ verify(panel);
2355+
2356+ var app = ApplicationManager.startApplication("dialer-app")
2357+ waitUntilAppWindowIsFullyLoaded(app);
2358+
2359+ // start dialer, maximize it
2360+ var appContainer = findChild(shell, "appContainer");
2361+ var appDelegate = findChild(appContainer, "appDelegate_dialer-app");
2362+ verify(appDelegate);
2363+ appDelegate.maximize();
2364+ tryCompare(appDelegate, "state", "maximized");
2365+
2366+ mousePress(panel);
2367+ mouseMove(shell, shell.width/2, shell.height/2);
2368+ mouseRelease(shell);
2369+
2370+ tryCompare(appDelegate, "state", "normal");
2371+ }
2348 }
2372 }
2349}
2373}