on xenial help sign in
apply nick's patch for fixing tiny window sizes
b8150afMichael Zanetti
qml/Stage/DecoratedWindow.qml+10−10
@@ -118,15 +118,15 @@ FocusScope {
118 name: "preview"; when: root.scaleToPreviewProgress > 0
118 name: "preview"; when: root.scaleToPreviewProgress > 0
119 PropertyChanges {
119 PropertyChanges {
120 target: root
120 target: root
121− implicitWidth: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedWidth, root.scaleToPreviewSize, root.scaleToPreviewProgress)
121+ implicitWidth: MathUtils.linearAnimation(0, 1, applicationWindow.requestedWidth, root.scaleToPreviewSize, root.scaleToPreviewProgress)
122− implicitHeight: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedHeight, root.scaleToPreviewSize, root.scaleToPreviewProgress)
122+ implicitHeight: MathUtils.linearAnimation(0, 1, applicationWindow.requestedHeight, root.scaleToPreviewSize, root.scaleToPreviewProgress)
123 }
123 }
124 PropertyChanges {
124 PropertyChanges {
125 target: applicationWindow;
125 target: applicationWindow;
126− requestedWidth: applicationWindow.oldRequestedWidth
126+// requestedWidth: applicationWindow.oldRequestedWidth
127− requestedHeight: applicationWindow.oldRequestedHeight
127+// requestedHeight: applicationWindow.oldRequestedHeight
128− width: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedWidth, applicationWindow.minSize, root.scaleToPreviewProgress)
128+ width: MathUtils.linearAnimation(0, 1, applicationWindow.requestedWidth, applicationWindow.minSize, root.scaleToPreviewProgress)
129− height: MathUtils.linearAnimation(0, 1, applicationWindow.oldRequestedHeight, applicationWindow.minSize, root.scaleToPreviewProgress)
129+ height: MathUtils.linearAnimation(0, 1, applicationWindow.requestedHeight, applicationWindow.minSize, root.scaleToPreviewProgress)
130 itemScale: root.implicitWidth / width
130 itemScale: root.implicitWidth / width
131 }
131 }
132 }
132 }
@@ -165,10 +165,10 @@ FocusScope {
165 height: implicitHeight
165 height: implicitHeight
166 requestedHeight: !counterRotate ? root.requestedHeight - d.requestedDecorationHeight : root.requestedWidth
166 requestedHeight: !counterRotate ? root.requestedHeight - d.requestedDecorationHeight : root.requestedWidth
167 requestedWidth: !counterRotate ? root.requestedWidth : root.requestedHeight - d.requestedDecorationHeight
167 requestedWidth: !counterRotate ? root.requestedWidth : root.requestedHeight - d.requestedDecorationHeight
168− property int oldRequestedWidth: requestedWidth
168+// property int oldRequestedWidth: requestedWidth
169− property int oldRequestedHeight: requestedHeight
169+// property int oldRequestedHeight: requestedHeight
170− onRequestedWidthChanged: oldRequestedWidth = requestedWidth
170+// onRequestedWidthChanged: oldRequestedWidth = requestedWidth
171− onRequestedHeightChanged: oldRequestedHeight = requestedHeight
171+// onRequestedHeightChanged: oldRequestedHeight = requestedHeight
172 focus: true
172 focus: true
173
173
174 property real itemScale: 1
174 property real itemScale: 1
qml/Stage/Stage.qml+31−20
@@ -1322,8 +1322,6 @@ FocusScope {
1322 y: spreadMaths.targetY
1322 y: spreadMaths.targetY
1323 z: index
1323 z: index
1324 height: spreadItem.spreadItemHeight
1324 height: spreadItem.spreadItemHeight
1325− requestedWidth: decoratedWindow.oldRequestedWidth
1326− requestedHeight: decoratedWindow.oldRequestedHeight
1327 visible: spreadMaths.itemVisible
1325 visible: spreadMaths.itemVisible
1328 }
1326 }
1329 PropertyChanges { target: dragArea; enabled: true }
1327 PropertyChanges { target: dragArea; enabled: true }
@@ -1343,8 +1341,6 @@ FocusScope {
1343 y: stagedRightEdgeMaths.animatedY
1341 y: stagedRightEdgeMaths.animatedY
1344 z: stagedRightEdgeMaths.animatedZ
1342 z: stagedRightEdgeMaths.animatedZ
1345 height: stagedRightEdgeMaths.animatedHeight
1343 height: stagedRightEdgeMaths.animatedHeight
1346− requestedWidth: decoratedWindow.oldRequestedWidth
1347− requestedHeight: decoratedWindow.oldRequestedHeight
1348 visible: appDelegate.x < root.width
1344 visible: appDelegate.x < root.width
1349 }
1345 }
1350 PropertyChanges {
1346 PropertyChanges {
@@ -1374,8 +1370,6 @@ FocusScope {
1374 y: windowedRightEdgeMaths.animatedY
1370 y: windowedRightEdgeMaths.animatedY
1375 z: windowedRightEdgeMaths.animatedZ
1371 z: windowedRightEdgeMaths.animatedZ
1376 height: stagedRightEdgeMaths.animatedHeight
1372 height: stagedRightEdgeMaths.animatedHeight
1377− requestedWidth: decoratedWindow.oldRequestedWidth
1378− requestedHeight: decoratedWindow.oldRequestedHeight
1379 }
1373 }
1380 PropertyChanges {
1374 PropertyChanges {
1381 target: decoratedWindow
1375 target: decoratedWindow
@@ -1398,11 +1392,15 @@ FocusScope {
1398 target: appDelegate
1392 target: appDelegate
1399 x: stageMaths.itemX
1393 x: stageMaths.itemX
1400 y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1394 y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1401− requestedWidth: appContainer.width
1402− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1403 visuallyMaximized: true
1395 visuallyMaximized: true
1404 visible: appDelegate.x < root.width
1396 visible: appDelegate.x < root.width
1405 }
1397 }
1398+ PropertyChanges {
1399+ target: appDelegate
1400+ requestedWidth: appContainer.width
1401+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1402+ restoreEntryValues: false
1403+ }
1406 PropertyChanges {
1404 PropertyChanges {
1407 target: decoratedWindow
1405 target: decoratedWindow
1408 hasDecoration: false
1406 hasDecoration: false
@@ -1427,11 +1425,15 @@ FocusScope {
1427 x: stageMaths.itemX
1425 x: stageMaths.itemX
1428 y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1426 y: appDelegate.fullscreen ? 0 : panelState.panelHeight
1429 z: stageMaths.itemZ
1427 z: stageMaths.itemZ
1430− requestedWidth: stageMaths.itemWidth
1431− requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1432 visuallyMaximized: true
1428 visuallyMaximized: true
1433 visible: appDelegate.x < root.width
1429 visible: appDelegate.x < root.width
1434 }
1430 }
1431+ PropertyChanges {
1432+ target: appDelegate
1433+ requestedWidth: stageMaths.itemWidth
1434+ requestedHeight: appDelegate.fullscreen ? appContainer.height : appContainer.height - panelState.panelHeight
1435+ restoreEntryValues: false
1436+ }
1435 PropertyChanges {
1437 PropertyChanges {
1436 target: decoratedWindow
1438 target: decoratedWindow
1437 hasDecoration: false
1439 hasDecoration: false
@@ -1449,8 +1451,12 @@ FocusScope {
1449 requestedY: 0;
1451 requestedY: 0;
1450 visuallyMinimized: false;
1452 visuallyMinimized: false;
1451 visuallyMaximized: true
1453 visuallyMaximized: true
1454+ }
1455+ PropertyChanges {
1456+ target: appDelegate
1452− requestedWidth: appContainer.width - root.leftMargin;
1457+ requestedWidth: appContainer.width - root.leftMargin
1453− requestedHeight: appContainer.height;
1458+ requestedHeight: appContainer.height
1459+ restoreEntryValues: false
1454 }
1460 }
1455 PropertyChanges { target: touchControls; enabled: true }
1461 PropertyChanges { target: touchControls; enabled: true }
1456 },
1462 },
@@ -1460,8 +1466,12 @@ FocusScope {
1460 target: appDelegate;
1466 target: appDelegate;
1461 requestedX: 0
1467 requestedX: 0
1462 requestedY: 0
1468 requestedY: 0
1469+ }
1470+ PropertyChanges {
1471+ target: appDelegate
1463− requestedWidth: appContainer.width;
1472+ requestedWidth: appContainer.width
1464− requestedHeight: appContainer.height;
1473+ requestedHeight: appContainer.height
1474+ restoreEntryValues: false
1465 }
1475 }
1466 PropertyChanges { target: decoratedWindow; hasDecoration: false }
1476 PropertyChanges { target: decoratedWindow; hasDecoration: false }
1467 },
1477 },
@@ -1476,6 +1486,12 @@ FocusScope {
1476 PropertyChanges { target: touchControls; enabled: true }
1486 PropertyChanges { target: touchControls; enabled: true }
1477 PropertyChanges { target: resizeArea; enabled: true }
1487 PropertyChanges { target: resizeArea; enabled: true }
1478 PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
1488 PropertyChanges { target: decoratedWindow; shadowOpacity: .3}
1489+ PropertyChanges {
1490+ target: appDelegate
1491+ requestedWidth: windowedWidth
1492+ requestedHeight: windowedHeight
1493+ restoreEntryValues: false
1494+ }
1479 },
1495 },
1480 State {
1496 State {
1481 name: "restored";
1497 name: "restored";
@@ -1693,6 +1709,7 @@ FocusScope {
1693 borderThickness: units.gu(2)
1709 borderThickness: units.gu(2)
1694 enabled: false
1710 enabled: false
1695 visible: enabled
1711 visible: enabled
1712+ readyToAssesBounds: !appDelegate._constructing
1696
1713
1697 onPressed: {
1714 onPressed: {
1698 appDelegate.activate();
1715 appDelegate.activate();
@@ -1720,12 +1737,6 @@ FocusScope {
1720 requestedWidth: appDelegate.requestedWidth
1737 requestedWidth: appDelegate.requestedWidth
1721 requestedHeight: appDelegate.requestedHeight
1738 requestedHeight: appDelegate.requestedHeight
1722
1739
1723− property int oldRequestedWidth: -1
1724− property int oldRequestedHeight: -1
1725−
1726− onRequestedWidthChanged: oldRequestedWidth = requestedWidth
1727− onRequestedHeightChanged: oldRequestedHeight = requestedHeight
1728−
1729 onCloseClicked: { appDelegate.close(); }
1740 onCloseClicked: { appDelegate.close(); }
1730 onMaximizeClicked: {
1741 onMaximizeClicked: {
1731 if (appDelegate.canBeMaximized) {
1742 if (appDelegate.canBeMaximized) {
qml/Stage/WindowResizeArea.qml+27−4
@@ -36,35 +36,58 @@ MouseArea {
36 property int minWidth: 0
36 property int minWidth: 0
37 property int minHeight: 0
37 property int minHeight: 0
38
38
39+ property bool readyToAssesBounds: false
40+ onReadyToAssesBoundsChanged: d.reassesBounds()
41+
39 QtObject {
42 QtObject {
40 id: d
43 id: d
41
44
42 readonly property int maxSafeInt: 2147483647
45 readonly property int maxSafeInt: 2147483647
43 readonly property int maxSizeIncrement: units.gu(40)
46 readonly property int maxSizeIncrement: units.gu(40)
44
47
48+ function reassesBounds() {
49+ if (!readyToAssesBounds) return;
50+
51+ if (target.windowedWidth < minimumWidth) {
52+ target.windowedWidth = minimumWidth;
53+ }
54+ if (target.windowedHeight < minimumHeight) {
55+ target.windowedHeight = minimumHeight;
56+ }
57+ if (target.windowedHeight < minimumHeight) {
58+ target.windowedHeight = minimumHeight;
59+ }
60+ if (target.windowedWidth > maximumWidth) {
61+ target.windowedWidth = maximumWidth;
62+ }
63+ if (target.windowedHeight > maximumHeight) {
64+ target.windowedHeight = maximumHeight;
65+ }
66+ }
67+
45 readonly property int minimumWidth: root.target ? Math.max(root.minWidth, root.target.minimumWidth) : root.minWidth
68 readonly property int minimumWidth: root.target ? Math.max(root.minWidth, root.target.minimumWidth) : root.minWidth
46 onMinimumWidthChanged: {
69 onMinimumWidthChanged: {
47− if (target.windowedWidth < minimumWidth) {
70+ if (readyToAssesBounds && target.windowedWidth < minimumWidth) {
48 target.windowedWidth = minimumWidth;
71 target.windowedWidth = minimumWidth;
49 }
72 }
50 }
73 }
51 readonly property int minimumHeight: root.target ? Math.max(root.minHeight, root.target.minimumHeight) : root.minHeight
74 readonly property int minimumHeight: root.target ? Math.max(root.minHeight, root.target.minimumHeight) : root.minHeight
52 onMinimumHeightChanged: {
75 onMinimumHeightChanged: {
53− if (target.windowedHeight < minimumHeight) {
76+ if (readyToAssesBounds && target.windowedHeight < minimumHeight) {
54 target.windowedHeight = minimumHeight;
77 target.windowedHeight = minimumHeight;
55 }
78 }
56 }
79 }
57 readonly property int maximumWidth: root.target && root.target.maximumWidth >= minimumWidth && root.target.maximumWidth > 0
80 readonly property int maximumWidth: root.target && root.target.maximumWidth >= minimumWidth && root.target.maximumWidth > 0
58 ? root.target.maximumWidth : maxSafeInt
81 ? root.target.maximumWidth : maxSafeInt
59 onMaximumWidthChanged: {
82 onMaximumWidthChanged: {
60− if (target.windowedWidth > maximumWidth) {
83+ if (readyToAssesBounds && target.windowedWidth > maximumWidth) {
61 target.windowedWidth = maximumWidth;
84 target.windowedWidth = maximumWidth;
62 }
85 }
63 }
86 }
64 readonly property int maximumHeight: root.target && root.target.maximumHeight >= minimumHeight && root.target.maximumHeight > 0
87 readonly property int maximumHeight: root.target && root.target.maximumHeight >= minimumHeight && root.target.maximumHeight > 0
65 ? root.target.maximumHeight : maxSafeInt
88 ? root.target.maximumHeight : maxSafeInt
66 onMaximumHeightChanged: {
89 onMaximumHeightChanged: {
67− if (target.windowedHeight > maximumHeight) {
90+ if (readyToAssesBounds && target.windowedHeight > maximumHeight) {
68 target.windowedHeight = maximumHeight;
91 target.windowedHeight = maximumHeight;
69 }
92 }
70 }
93 }
qml/Stage/WindowStateSaver.qml−2
@@ -48,8 +48,6 @@ QtObject {
48 target.normalX = target.windowedX;
48 target.normalX = target.windowedX;
49 target.normalY = target.windowedY;
49 target.normalY = target.windowedY;
50
50
51− target.updateNormalGeometry();
52−
53 // initialize the x/y to restore to
51 // initialize the x/y to restore to
54 target.restoredX = target.normalX;
52 target.restoredX = target.normalX;
55 target.restoredY = target.normalY;
53 target.restoredY = target.normalY;