@@ -59,6 +59,18 @@ MouseArea {
5959 property bool topBorder: false
6060 property bool bottomBorder: false
6161
62+ // true - A change in surface size will cause the left border of the window to move accordingly.
63+ // The window's right border will stay in the same position.
64+ // false - a change in surface size will cause the right border of the window to move accordingly.
65+ // The window's left border will stay in the same position.
66+ property bool moveLeftBorder: false
67+
68+ // true - A change in surface size will cause the top border of the window to move accordingly.
69+ // The window's bottom border will stay in the same position.
70+ // false - a change in surface size will cause the bottom border of the window to move accordingly.
71+ // The window's top border will stay in the same position.
72+ property bool moveTopBorder: false
73+
6274 property bool dragging: false
6375 property real startMousePosX
6476 property real startMousePosY
@@ -106,11 +118,24 @@ MouseArea {
106118 }
107119 }
108120
121+ Timer {
122+ id: resetBordersToMoveTimer
123+ interval: 2000
124+ onTriggered: {
125+ d.moveLeftBorder = false;
126+ d.moveTopBorder = false;
127+ }
128+ }
129+
109130 onPressedChanged: {
110131 var pos = mapToItem(target.parent, mouseX, mouseY);
111132
112133 if (pressed) {
113134 d.updateBorders();
135+ resetBordersToMoveTimer.stop();
136+ d.moveLeftBorder = d.leftBorder;
137+ d.moveTopBorder = d.topBorder;
138+
114139 var pos = mapToItem(root.target.parent, mouseX, mouseY);
115140 d.startMousePosX = pos.x;
116141 d.startMousePosY = pos.y;
@@ -122,6 +147,7 @@ MouseArea {
122147 d.currentHeight = target.height;
123148 d.dragging = true;
124149 } else {
150+ resetBordersToMoveTimer.start();
125151 d.dragging = false;
126152 if (containsMouse) {
127153 d.updateBorders();
@@ -185,13 +211,13 @@ MouseArea {
185211 Connections {
186212 target: root.target
187213 onWidthChanged: {
188− if (root.pressed && d.leftBorder) {
214+ if (d.moveLeftBorder) {
189215 target.x += d.currentWidth - target.width;
190216 }
191217 d.currentWidth = target.width;
192218 }
193219 onHeightChanged: {
194− if (root.pressed && d.topBorder) {
220+ if (d.moveTopBorder) {
195221 target.y += d.currentHeight - target.height;
196222 }
197223 d.currentHeight = target.height;