@@ -74,28 +74,24 @@ MouseArea {
74 var mouseDiff = Qt.point(currentPoint.x - priv.startPoint.x, currentPoint.y - priv.startPoint.y);
74 var mouseDiff = Qt.point(currentPoint.x - priv.startPoint.x, currentPoint.y - priv.startPoint.y);
75 var moveDiff = Qt.point(0, 0);
75 var moveDiff = Qt.point(0, 0);
76 var sizeDiff = Qt.point(0, 0);
76 var sizeDiff = Qt.point(0, 0);
77+ var maxSizeDiff = Qt.point(root.minWidth - root.target.width, root.minHeight - root.target.height)
77 if (priv.resizeTop || priv.resizeBottom || priv.resizeLeft || priv.resizeRight) {
79 if (priv.resizeTop || priv.resizeBottom || priv.resizeLeft || priv.resizeRight) {
78 if (priv.resizeTop) {
80 if (priv.resizeTop) {
79− moveDiff.y += mouseDiff.y;
81+ sizeDiff.y = Math.max(maxSizeDiff.y, -currentPoint.y + priv.startPoint.y)
80− sizeDiff.y += -mouseDiff.y;
82+ moveDiff.y = -sizeDiff.y
81− } else if (priv.resizeBottom) {
82− sizeDiff.y += mouse.y - priv.startPoint.y;
83− priv.startPoint.y = mouse.y
85− if (priv.resizeLeft) {
84+ if (priv.resizeBottom) {
86− moveDiff.x += mouseDiff.x;
85+ sizeDiff.y = Math.max(maxSizeDiff.y, currentPoint.y - priv.startPoint.y)
87− sizeDiff.x += -mouseDiff.x;
86+ priv.startPoint.y += sizeDiff.y
88− } else if (priv.resizeRight) {
89− sizeDiff.x += mouse.x - priv.startPoint.x;
90− priv.startPoint.x = mouse.x
92− if (priv.windowWidth + sizeDiff.x < root.minWidth) {
88+ if (priv.resizeLeft) {
93− sizeDiff.x = root.minWidth - priv.windowWidth;
89+ sizeDiff.x = Math.max(maxSizeDiff.x, -currentPoint.x + priv.startPoint.x)
94− moveDiff.x = moveDiff.x == 0 ? 0 : -sizeDiff.x;
90+ moveDiff.x = -sizeDiff.x
96− if (priv.windowHeight + sizeDiff.y < root.minHeight) {
92+ if (priv.resizeRight) {
97− sizeDiff.y = root.minHeight - priv.windowHeight;
93+ sizeDiff.x = Math.max(maxSizeDiff.x, currentPoint.x - priv.startPoint.x)
98− moveDiff.y = moveDiff.y == 0 ? 0 : -sizeDiff.y;
94+ priv.startPoint.x += sizeDiff.x
101 target.x += moveDiff.x;
97 target.x += moveDiff.x;
@@ -106,6 +102,7 @@ MouseArea {
106 target.x += mouseDiff.x;
102 target.x += mouseDiff.x;
107 target.y += mouseDiff.y;
103 target.y += mouseDiff.y;
111 onReleased: {
108 onReleased: {