on xenial help sign in
apply a better workaround for WindowResizeArea margins

to help with more accurate grip resizing

commite077182860124331616c8ad8477cec9e5d912c76 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateMon 30 May 2016, 20:26 (10 years ago) parent239fdcc
2 files changed+5−9
qml/Stages/DesktopStage.qml+4−1 qml/Stages/WindowResizeArea.qml+1−8
qml/Stages/DesktopStage.qml+4−1
@@ -584,6 +584,10 @@ AbstractStage {
584584 WindowResizeArea {
585585 id: resizeArea
586586 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+
587591 target: appDelegate
588592 minWidth: units.gu(10)
589593 minHeight: units.gu(10)
@@ -592,7 +596,6 @@ AbstractStage {
592596 screenWidth: appContainer.width
593597 screenHeight: appContainer.height
594598 leftMargin: root.leftMargin
595− touchMode: touchControls.overlayShown
596599
597600 onPressed: { appDelegate.focus = true; }
598601
qml/Stages/WindowResizeArea.qml+1−8
@@ -23,15 +23,9 @@ import "../Components/PanelState"
2323MouseArea {
2424 id: root
2525
26− // we either fill the target (for mouse)...
27− anchors.fill: !touchMode ? target : undefined
26+ anchors.fill: target
2827 anchors.margins: -borderThickness
2928
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−
3529 hoverEnabled: target && !target.maximized // don't grab the resize under the panel
3630
3731 property var windowStateStorage: WindowStateStorage
@@ -49,7 +43,6 @@ MouseArea {
4943 property int screenWidth: 0
5044 property int screenHeight: 0
5145 property int leftMargin: 0
52− property bool touchMode: false
5346
5447 QtObject {
5548 id: priv