on xenial help sign in
extract the drag-down-panel feature into a different branch
commit4d09f00f67c71464175b744a0fb2ab2b00d74db1 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateTue 29 Mar 2016, 16:00 (11 years ago) parentb6176e8
2 files changed−34
qml/Panel/Panel.qml−10 tests/qmltests/tst_Shell.qml−24
qml/Panel/Panel.qml−10
@@ -101,7 +101,6 @@ Item {
101101 }
102102
103103 MouseArea {
104− objectName: "windowControlArea"
105104 anchors {
106105 top: parent.top
107106 left: parent.left
@@ -112,15 +111,6 @@ Item {
112111 onClicked: callHint.visible ? callHint.showLiveCall() : PanelState.focusMaximizedApp()
113112 onDoubleClicked: PanelState.maximize()
114113
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−
124114 // WindowControlButtons inside the mouse area, otherwise QML doesn't grok nested hover events :/
125115 // cf. https://bugreports.qt.io/browse/QTBUG-32909
126116 WindowControlButtons {
tests/qmltests/tst_Shell.qml−24
@@ -2344,29 +2344,5 @@ Rectangle {
23442344 tryCompare(app2.session.lastSurface, "keymapLayout", "fr");
23452345 tryCompare(app2.session.lastSurface, "keymapVariant", "");
23462346 }
2347−
2348− function test_dragPanelToRestoreMaximizedWindow() {
2349− loadShell("desktop");
2350− shell.usageScenario = "desktop";
2351− waitForRendering(shell);
2352− var panel = findChild(shell, "windowControlArea");
2353− verify(panel);
2354−
2355− var app = ApplicationManager.startApplication("dialer-app")
2356− waitUntilAppWindowIsFullyLoaded(app);
2357−
2358− // start dialer, maximize it
2359− var appContainer = findChild(shell, "appContainer");
2360− var appDelegate = findChild(appContainer, "appDelegate_dialer-app");
2361− verify(appDelegate);
2362− appDelegate.maximize();
2363− tryCompare(appDelegate, "state", "maximized");
2364−
2365− mousePress(panel);
2366− mouseMove(shell, shell.width/2, shell.height/2);
2367− mouseRelease(shell);
2368−
2369− tryCompare(appDelegate, "state", "normal");
2370− }
23712347 }
23722348}