on xenial help sign in
split the windowed geometry from the staged ones to have less collisions
ea69283Michael Zanetti
po/unity8.pot+1−1
@@ -8,7 +8,7 @@ msgid ""
8msgstr ""
8msgstr ""
9"Project-Id-Version: unity8\n"
9"Project-Id-Version: unity8\n"
10"Report-Msgid-Bugs-To: \n"
10"Report-Msgid-Bugs-To: \n"
11−"POT-Creation-Date: 2016-07-11 16:21+0200\n"
11+"POT-Creation-Date: 2016-07-12 11:45+0200\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
qml/Stages/DesktopStage.qml+16−5
@@ -424,6 +424,12 @@ AbstractStage {
424 y: requestedY // may be overridden in some states. Do not directly write to this.
424 y: requestedY // may be overridden in some states. Do not directly write to this.
425 property real requestedX: priv.focusedAppDelegate ? priv.focusedAppDelegate.x + units.gu(3) : (normalZ - 1) * units.gu(3)
425 property real requestedX: priv.focusedAppDelegate ? priv.focusedAppDelegate.x + units.gu(3) : (normalZ - 1) * units.gu(3)
426 property real requestedY: priv.focusedAppDelegate ? priv.focusedAppDelegate.y + units.gu(3) : normalZ * units.gu(3)
426 property real requestedY: priv.focusedAppDelegate ? priv.focusedAppDelegate.y + units.gu(3) : normalZ * units.gu(3)
427+ property int requestedWidth: -1
428+ property int requestedHeight: -1
429+ property int windowedX
430+ property int windowedY
431+ property int windowedWidth
432+ property int windowedHeight
427
433
428 Binding {
434 Binding {
429 target: appDelegate
435 target: appDelegate
@@ -470,9 +476,6 @@ AbstractStage {
470 readonly property alias widthIncrement: decoratedWindow.widthIncrement
476 readonly property alias widthIncrement: decoratedWindow.widthIncrement
471 readonly property alias heightIncrement: decoratedWindow.heightIncrement
477 readonly property alias heightIncrement: decoratedWindow.heightIncrement
472
478
473− property int requestedWidth: -1
474− property int requestedHeight: -1
475−
476 readonly property bool maximized: windowState & WindowStateStorage.WindowStateMaximized
479 readonly property bool maximized: windowState & WindowStateStorage.WindowStateMaximized
477 readonly property bool maximizedLeft: windowState & WindowStateStorage.WindowStateMaximizedLeft
480 readonly property bool maximizedLeft: windowState & WindowStateStorage.WindowStateMaximizedLeft
478 readonly property bool maximizedRight: windowState & WindowStateStorage.WindowStateMaximizedRight
481 readonly property bool maximizedRight: windowState & WindowStateStorage.WindowStateMaximizedRight
@@ -827,7 +830,15 @@ AbstractStage {
827 State {
830 State {
828 name: "normal";
831 name: "normal";
829 when: appDelegate.windowState == WindowStateStorage.WindowStateNormal
832 when: appDelegate.windowState == WindowStateStorage.WindowStateNormal
833+ PropertyChanges {
834+ target: appDelegate
830− PropertyChanges { target: appDelegate; visuallyMinimized: false; visuallyMaximized: false; }
835+ visuallyMinimized: false
836+ visuallyMaximized: false
837+ requestedX: appDelegate.windowedX
838+ requestedY: appDelegate.windowedY
839+ requestedWidth: appDelegate.windowedWidth
840+ requestedHeight: appDelegate.windowedHeight
841+ }
831 PropertyChanges { target: touchControls; enabled: true }
842 PropertyChanges { target: touchControls; enabled: true }
832 },
843 },
833 State {
844 State {
@@ -932,7 +943,7 @@ AbstractStage {
932 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedWidth,requestedHeight"; duration: priv.animationDuration }
943 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,requestedWidth,requestedHeight"; duration: priv.animationDuration }
933 },
944 },
934 Transition {
945 Transition {
935− to: "staged"
946+ from: "normal,spread"; to: "staged"
936 UbuntuNumberAnimation { target: appDelegate; properties: "x,y"; duration: priv.animationDuration }
947 UbuntuNumberAnimation { target: appDelegate; properties: "x,y"; duration: priv.animationDuration }
937 UbuntuNumberAnimation { target: appDelegate; properties: "requestedWidth,requestedHeight"; duration: priv.animationDuration }
948 UbuntuNumberAnimation { target: appDelegate; properties: "requestedWidth,requestedHeight"; duration: priv.animationDuration }
938 },
949 },
qml/Stages/WindowControlsOverlay.qml+2−2
@@ -94,8 +94,8 @@ Item {
94 function handlePositionChanged(mouseX, mouseY) {
94 function handlePositionChanged(mouseX, mouseY) {
95 if (priv.dragging) {
95 if (priv.dragging) {
96 var pos = mapToItem(root.target.parent, mouseX, mouseY);
96 var pos = mapToItem(root.target.parent, mouseX, mouseY);
97− root.target.requestedX = Math.round(pos.x - priv.distanceX);
97+ root.target.windowedX = Math.round(pos.x - priv.distanceX);
98− root.target.requestedY = Math.round(Math.max(pos.y - priv.distanceY, PanelState.panelHeight));
98+ root.target.windowedY = Math.round(Math.max(pos.y - priv.distanceY, PanelState.panelHeight));
99 }
99 }
100 }
100 }
101 }
101 }
qml/Stages/WindowResizeArea.qml+33−33
@@ -55,8 +55,8 @@ MouseArea {
55
55
56 function updateNormalGeometry() {
56 function updateNormalGeometry() {
57 if (root.target.state == "normal") {
57 if (root.target.state == "normal") {
58− normalX = root.target.requestedX
58+ normalX = root.target.windowedX
59− normalY = root.target.requestedY
59+ normalY = root.target.windowedY
60 normalWidth = root.target.width
60 normalWidth = root.target.width
61 normalHeight = root.target.height
61 normalHeight = root.target.height
62 }
62 }
@@ -73,16 +73,16 @@ MouseArea {
73
73
74 function loadWindowState() {
74 function loadWindowState() {
75 var windowGeometry = windowStateStorage.getGeometry(root.windowId,
75 var windowGeometry = windowStateStorage.getGeometry(root.windowId,
76− Qt.rect(target.requestedX, target.requestedY, defaultWidth, defaultHeight));
76+ Qt.rect(target.windowedX, target.windowedY, defaultWidth, defaultHeight));
77
77
78
78
79 print("loading Window state!", root.windowId, windowGeometry.width, windowGeometry.height)
79 print("loading Window state!", root.windowId, windowGeometry.width, windowGeometry.height)
80− target.requestedWidth = Qt.binding(function() { return Math.min(Math.max(windowGeometry.width, d.minimumWidth), screenWidth - root.leftMargin); });
80+ target.windowedWidth = Qt.binding(function() { return Math.min(Math.max(windowGeometry.width, d.minimumWidth), screenWidth - root.leftMargin); });
81− target.requestedHeight = Qt.binding(function() { return Math.min(Math.max(windowGeometry.height, d.minimumHeight),
81+ target.windowedHeight = Qt.binding(function() { return Math.min(Math.max(windowGeometry.height, d.minimumHeight),
82 root.screenHeight - (target.fullscreen ? 0 : PanelState.panelHeight)); });
82 root.screenHeight - (target.fullscreen ? 0 : PanelState.panelHeight)); });
83− target.requestedX = Qt.binding(function() { return Math.max(Math.min(windowGeometry.x, root.screenWidth - root.leftMargin - target.requestedWidth),
83+ target.windowedX = Qt.binding(function() { return Math.max(Math.min(windowGeometry.x, root.screenWidth - root.leftMargin - target.windowedWidth),
84 (target.fullscreen ? 0 : root.leftMargin)); });
84 (target.fullscreen ? 0 : root.leftMargin)); });
85− target.requestedY = Qt.binding(function() { return Math.max(Math.min(windowGeometry.y, root.screenHeight - target.requestedHeight), PanelState.panelHeight); });
85+ target.windowedY = Qt.binding(function() { return Math.max(Math.min(windowGeometry.y, root.screenHeight - target.windowedHeight), PanelState.panelHeight); });
86
86
87 var windowState = windowStateStorage.getState(root.windowId, WindowStateStorage.WindowStateNormal)
87 var windowState = windowStateStorage.getState(root.windowId, WindowStateStorage.WindowStateNormal)
88 switch (windowState) {
88 switch (windowState) {
@@ -124,28 +124,28 @@ MouseArea {
124
124
125 readonly property int minimumWidth: root.target ? Math.max(root.minWidth, root.target.minimumWidth) : root.minWidth
125 readonly property int minimumWidth: root.target ? Math.max(root.minWidth, root.target.minimumWidth) : root.minWidth
126 onMinimumWidthChanged: {
126 onMinimumWidthChanged: {
127− if (target.requestedWidth < minimumWidth) {
127+ if (target.windowedWidth < minimumWidth) {
128− target.requestedWidth = minimumWidth;
128+ target.windowedWidth = minimumWidth;
129 }
129 }
130 }
130 }
131 readonly property int minimumHeight: root.target ? Math.max(root.minHeight, root.target.minimumHeight) : root.minHeight
131 readonly property int minimumHeight: root.target ? Math.max(root.minHeight, root.target.minimumHeight) : root.minHeight
132 onMinimumHeightChanged: {
132 onMinimumHeightChanged: {
133− if (target.requestedHeight < minimumHeight) {
133+ if (target.windowedHeight < minimumHeight) {
134− target.requestedHeight = minimumHeight;
134+ target.windowedHeight = minimumHeight;
135 }
135 }
136 }
136 }
137 readonly property int maximumWidth: root.target && root.target.maximumWidth >= minimumWidth && root.target.maximumWidth > 0
137 readonly property int maximumWidth: root.target && root.target.maximumWidth >= minimumWidth && root.target.maximumWidth > 0
138 ? root.target.maximumWidth : maxSafeInt
138 ? root.target.maximumWidth : maxSafeInt
139 onMaximumWidthChanged: {
139 onMaximumWidthChanged: {
140− if (target.requestedWidth > maximumWidth) {
140+ if (target.windowedWidth > maximumWidth) {
141− target.requestedWidth = maximumWidth;
141+ target.windowedWidth = maximumWidth;
142 }
142 }
143 }
143 }
144 readonly property int maximumHeight: root.target && root.target.maximumHeight >= minimumHeight && root.target.maximumHeight > 0
144 readonly property int maximumHeight: root.target && root.target.maximumHeight >= minimumHeight && root.target.maximumHeight > 0
145 ? root.target.maximumHeight : maxSafeInt
145 ? root.target.maximumHeight : maxSafeInt
146 onMaximumHeightChanged: {
146 onMaximumHeightChanged: {
147− if (target.requestedHeight > maximumHeight) {
147+ if (target.windowedHeight > maximumHeight) {
148− target.requestedHeight = maximumHeight;
148+ target.windowedHeight = maximumHeight;
149 }
149 }
150 }
150 }
151 readonly property int widthIncrement: {
151 readonly property int widthIncrement: {
@@ -260,8 +260,8 @@ MouseArea {
260 var pos = mapToItem(root.target.parent, mouseX, mouseY);
260 var pos = mapToItem(root.target.parent, mouseX, mouseY);
261 d.startMousePosX = pos.x;
261 d.startMousePosX = pos.x;
262 d.startMousePosY = pos.y;
262 d.startMousePosY = pos.y;
263− d.startX = target.requestedX;
263+ d.startX = target.windowedX;
264− d.startY = target.requestedY;
264+ d.startY = target.windowedY;
265 d.startWidth = target.width;
265 d.startWidth = target.width;
266 d.startHeight = target.height;
266 d.startHeight = target.height;
267 d.currentWidth = target.width;
267 d.currentWidth = target.width;
@@ -298,53 +298,53 @@ MouseArea {
298
298
299 if (d.leftBorder) {
299 if (d.leftBorder) {
300 var newTargetX = d.startX + deltaX;
300 var newTargetX = d.startX + deltaX;
301− var rightBorderX = target.requestedX + target.width;
301+ var rightBorderX = target.windowedX + target.width;
302 if (rightBorderX > newTargetX + d.minimumWidth) {
302 if (rightBorderX > newTargetX + d.minimumWidth) {
303 if (rightBorderX < newTargetX + d.maximumWidth) {
303 if (rightBorderX < newTargetX + d.maximumWidth) {
304− target.requestedWidth = rightBorderX - newTargetX;
304+ target.windowedWidth = rightBorderX - newTargetX;
305 } else {
305 } else {
306− target.requestedWidth = d.maximumWidth;
306+ target.windowedWidth = d.maximumWidth;
307 }
307 }
308 } else {
308 } else {
309− target.requestedWidth = d.minimumWidth;
309+ target.windowedWidth = d.minimumWidth;
310 }
310 }
311
311
312 } else if (d.rightBorder) {
312 } else if (d.rightBorder) {
313 var newWidth = d.startWidth + deltaX;
313 var newWidth = d.startWidth + deltaX;
314 if (newWidth > d.minimumWidth) {
314 if (newWidth > d.minimumWidth) {
315 if (newWidth < d.maximumWidth) {
315 if (newWidth < d.maximumWidth) {
316− target.requestedWidth = newWidth;
316+ target.windowedWidth = newWidth;
317 } else {
317 } else {
318− target.requestedWidth = d.maximumWidth;
318+ target.windowedWidth = d.maximumWidth;
319 }
319 }
320 } else {
320 } else {
321− target.requestedWidth = d.minimumWidth;
321+ target.windowedWidth = d.minimumWidth;
322 }
322 }
323 }
323 }
324
324
325 if (d.topBorder) {
325 if (d.topBorder) {
326 var newTargetY = Math.max(d.startY + deltaY, PanelState.panelHeight); // disallow resizing up past Panel
326 var newTargetY = Math.max(d.startY + deltaY, PanelState.panelHeight); // disallow resizing up past Panel
327− var bottomBorderY = target.requestedY + target.height;
327+ var bottomBorderY = target.windowedY + target.height;
328 if (bottomBorderY > newTargetY + d.minimumHeight) {
328 if (bottomBorderY > newTargetY + d.minimumHeight) {
329 if (bottomBorderY < newTargetY + d.maximumHeight) {
329 if (bottomBorderY < newTargetY + d.maximumHeight) {
330− target.requestedHeight = bottomBorderY - newTargetY;
330+ target.windowedHeight = bottomBorderY - newTargetY;
331 } else {
331 } else {
332− target.requestedHeight = d.maximumHeight;
332+ target.windowedHeight = d.maximumHeight;
333 }
333 }
334 } else {
334 } else {
335− target.requestedHeight = d.minimumHeight;
335+ target.windowedHeight = d.minimumHeight;
336 }
336 }
337
337
338 } else if (d.bottomBorder) {
338 } else if (d.bottomBorder) {
339 var newHeight = d.startHeight + deltaY;
339 var newHeight = d.startHeight + deltaY;
340 if (newHeight > d.minimumHeight) {
340 if (newHeight > d.minimumHeight) {
341 if (newHeight < d.maximumHeight) {
341 if (newHeight < d.maximumHeight) {
342− target.requestedHeight = newHeight;
342+ target.windowedHeight = newHeight;
343 } else {
343 } else {
344− target.requestedHeight = d.maximumHeight;
344+ target.windowedHeight = d.maximumHeight;
345 }
345 }
346 } else {
346 } else {
347− target.requestedHeight = d.minimumHeight;
347+ target.windowedHeight = d.minimumHeight;
348 }
348 }
349 }
349 }
350 }
350 }
@@ -353,13 +353,13 @@ MouseArea {
353 target: root.target
353 target: root.target
354 onWidthChanged: {
354 onWidthChanged: {
355 if (d.moveLeftBorder) {
355 if (d.moveLeftBorder) {
356− target.requestedX += d.currentWidth - target.width;
356+ target.windowedX += d.currentWidth - target.width;
357 }
357 }
358 d.currentWidth = target.width;
358 d.currentWidth = target.width;
359 }
359 }
360 onHeightChanged: {
360 onHeightChanged: {
361 if (d.moveTopBorder) {
361 if (d.moveTopBorder) {
362− target.requestedY += d.currentHeight - target.height;
362+ target.windowedY += d.currentHeight - target.height;
363 }
363 }
364 d.currentHeight = target.height;
364 d.currentHeight = target.height;
365 }
365 }