@@ -102,13 +102,21 @@ Item {
102 hoverEnabled: true
102 hoverEnabled: true
103 onClicked: callHint.visible ? callHint.showLiveCall() : PanelState.focusMaximizedApp()
103 onClicked: callHint.visible ? callHint.showLiveCall() : PanelState.focusMaximizedApp()
104 onDoubleClicked: PanelState.restoreClicked()
104 onDoubleClicked: PanelState.restoreClicked()
105−
105+ drag.target: PanelState.maximizedAppDelegate
106− property bool mouseWasPressed: false
106+ drag.axis: Drag.XAndYAxis
107− onPressed: mouseWasPressed = containsPress
107+ drag.minimumX: 0
108− onMouseYChanged: {
108+ drag.minimumY: panelHeight
109− if (mouseWasPressed && mouseY > panelHeight) {
109+ drag.maximumX: PanelState.maximizedAppDelegate ? PanelState.maximizedAppDelegate.moveHandler.stageWidth : 0
110− PanelState.restoreClicked(); // restore the window when "dragging" the panel down
110+ drag.maximumY: PanelState.maximizedAppDelegate ? PanelState.maximizedAppDelegate.moveHandler.stageHeight : 0
111− mouseWasPressed = false;
111+ drag.threshold: panelHeight
112+ drag.filterChildren: true
115+ var delegate = PanelState.maximizedAppDelegate;
116+ print("!!! Released drag at", mouse.x, mouse.y, drag.active)
117+ delegate.restoredX = Math.round(mouse.x - delegate.moveHandler.buttonsWidth);
118+ delegate.restoredY = Math.round(Math.max(mouse.y, panelHeight));
119+ delegate.restoreFromMaximized(false);