on xenial help sign in
apply a better workaround for WindowResizeArea margins
e077182Lukáš Tinkl
qml/Stages/DesktopStage.qml+4−1
@@ -584,6 +584,10 @@ AbstractStage {
584 WindowResizeArea {
584 WindowResizeArea {
585 id: resizeArea
585 id: resizeArea
586 objectName: "windowResizeArea"
586 objectName: "windowResizeArea"
587+
588+ // workaround so that it chooses the correct resize borders when you drag from a corner ResizeGrip
589+ anchors.margins: touchControls.overlayShown ? borderThickness/2 : -borderThickness
590+
587 target: appDelegate
591 target: appDelegate
588 minWidth: units.gu(10)
592 minWidth: units.gu(10)
589 minHeight: units.gu(10)
593 minHeight: units.gu(10)
@@ -592,7 +596,6 @@ AbstractStage {
592 screenWidth: appContainer.width
596 screenWidth: appContainer.width
593 screenHeight: appContainer.height
597 screenHeight: appContainer.height
594 leftMargin: root.leftMargin
598 leftMargin: root.leftMargin
595− touchMode: touchControls.overlayShown
596
599
597 onPressed: { appDelegate.focus = true; }
600 onPressed: { appDelegate.focus = true; }
598
601
qml/Stages/WindowResizeArea.qml+1−8
@@ -23,15 +23,9 @@ import "../Components/PanelState"
23MouseArea {
23MouseArea {
24 id: root
24 id: root
25
25
26− // we either fill the target (for mouse)...
27− anchors.fill: !touchMode ? target : undefined
26+ anchors.fill: target
28 anchors.margins: -borderThickness
27 anchors.margins: -borderThickness
29
28
30− // ... or put it on top for touch controls
31− anchors.centerIn: touchMode ? target : undefined
32− width: touchMode ? target.width - borderThickness/2 : undefined
33− height: touchMode ? target.height - borderThickness/2 : undefined
34−
35 hoverEnabled: target && !target.maximized // don't grab the resize under the panel
29 hoverEnabled: target && !target.maximized // don't grab the resize under the panel
36
30
37 property var windowStateStorage: WindowStateStorage
31 property var windowStateStorage: WindowStateStorage
@@ -49,7 +43,6 @@ MouseArea {
49 property int screenWidth: 0
43 property int screenWidth: 0
50 property int screenHeight: 0
44 property int screenHeight: 0
51 property int leftMargin: 0
45 property int leftMargin: 0
52− property bool touchMode: false
53
46
54 QtObject {
47 QtObject {
55 id: priv
48 id: priv