Merge lp:~mzanetti/unity8/40-50-90 into lp:unity8

Proposed by Michael Zanetti
Status: Rejected
Rejected by: Albert Astals Cid
Proposed branch: lp:~mzanetti/unity8/40-50-90
Merge into: lp:unity8
Prerequisite: lp:~dandrader/unity8/fixOrientedShellTests
Diff against target: 285 lines (+62/-9)
10 files modified
qml/Greeter/CoverPage.qml (+2/-0)
qml/Greeter/Greeter.qml (+8/-0)
qml/Greeter/NarrowView.qml (+1/-0)
qml/Launcher/Launcher.qml (+3/-2)
qml/OrientedShell.qml (+21/-1)
qml/Rotation/ImmediateRotationAction.qml (+4/-1)
qml/Rotation/NinetyRotationAnimation.qml (+6/-3)
qml/Shell.qml (+8/-0)
qml/Stages/PhoneStage.qml (+2/-1)
qml/Stages/TabletStage.qml (+7/-1)
To merge this branch: bzr merge lp:~mzanetti/unity8/40-50-90
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Disapprove
PS Jenkins bot (community) continuous-integration Needs Fixing
Daniel d'Andrada (community) Needs Fixing
Review via email: mp+263488@code.launchpad.net

This proposal supersedes a proposal from 2015-07-01.

Commit message

Restrict the shell width to 40, 50 or 90 grid units when in portrait.

Paint black borders to fill up screen space.

Description of the change

Requires adjustment of the grid unit size on some devices (see below). Create a file ~/.config/upstart/gu.conf on the device with this content (changing the GRID_UNIT_PX value):

start on starting dbus
exec initctl set-env --global GRID_UNIT_PX=XX

--------
* On Nexus 7:
for 50 gu, use GRID_UNIT_PX=24
for 90 gu, use GRID_UNIT_PX=13

* On Aquaris E4.5 the default is ok for 40 gu. No need to change anything.

* On Meizu MX4, for 50 gu use GRID_UNIT_PX=23

To post a comment you must log in.
lp:~mzanetti/unity8/40-50-90 updated
1836. By Michael Zanetti

revert bad change

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Can't pull in the greeter from the right edge on the krillin

review: Needs Fixing
lp:~mzanetti/unity8/40-50-90 updated
1837. By Michael Zanetti

fix greeter not being swipable from the edge

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

Where's the checklist in the description?

Revision history for this message
Daniel d'Andrada (dandrader) wrote :
review: Needs Fixing
Revision history for this message
Daniel d'Andrada (dandrader) wrote :

I still think it would be better to isolate this thing (black borders concept) by having this scene hierarchy:

Rectangle {
    color: "black"

    OrientedShell {
        // do the 40-50-90 geometry restrictions here.
    }
}

Hopefully you wouldn't have to touch Rotation animation, Stages or Greeter code.

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

By the way, it could be interesting to add arale configuration to tst_OrientedShell.qml as it would be one of the cases that would get those controversial black borders (right?).

lp:~mzanetti/unity8/40-50-90 updated
1838. By Michael Zanetti

only use this weirdness when the native orientation is portrait

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

Reject this for the moment?

review: Needs Information
Revision history for this message
Albert Astals Cid (aacid) :
review: Disapprove

Unmerged revisions

1838. By Michael Zanetti

only use this weirdness when the native orientation is portrait

1837. By Michael Zanetti

fix greeter not being swipable from the edge

1836. By Michael Zanetti

revert bad change

1835. By Michael Zanetti

fixes

1834. By Michael Zanetti

fix mouse event eater in launcher

1833. By Michael Zanetti

restrict viewport to 40, 50 or 90 gu

1832. By Michael Zanetti

merge orientedShellFixes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'qml/Greeter/CoverPage.qml'
--- qml/Greeter/CoverPage.qml 2015-05-11 14:36:03 +0000
+++ qml/Greeter/CoverPage.qml 2015-07-02 16:54:47 +0000
@@ -23,6 +23,7 @@
23 id: root23 id: root
2424
25 property real dragHandleLeftMargin25 property real dragHandleLeftMargin
26 property int shellBorderWidth: 0
26 property real launcherOffset27 property real launcherOffset
27 property alias background: greeterBackground.source28 property alias background: greeterBackground.source
28 property real backgroundTopMargin29 property real backgroundTopMargin
@@ -132,6 +133,7 @@
132 objectName: "coverPageDragHandle"133 objectName: "coverPageDragHandle"
133 anchors.fill: parent134 anchors.fill: parent
134 anchors.leftMargin: root.dragHandleLeftMargin135 anchors.leftMargin: root.dragHandleLeftMargin
136 anchors.rightMargin: -root.shellBorderWidth
135 enabled: root.draggable137 enabled: root.draggable
136 direction: Direction.Horizontal138 direction: Direction.Horizontal
137139
138140
=== modified file 'qml/Greeter/Greeter.qml'
--- qml/Greeter/Greeter.qml 2015-06-12 16:07:43 +0000
+++ qml/Greeter/Greeter.qml 2015-07-02 16:54:47 +0000
@@ -52,6 +52,8 @@
52 property int failedLoginsDelayAttempts: 7 // number of failed logins52 property int failedLoginsDelayAttempts: 7 // number of failed logins
53 property real failedLoginsDelayMinutes: 5 // minutes of forced waiting53 property real failedLoginsDelayMinutes: 5 // minutes of forced waiting
5454
55 property int shellBorderWidth: 0
56
55 readonly property bool animating: loader.item ? loader.item.animating : false57 readonly property bool animating: loader.item ? loader.item.animating : false
5658
57 signal tease()59 signal tease()
@@ -314,6 +316,12 @@
314 property: "infographicModel"316 property: "infographicModel"
315 value: LightDM.Infographic317 value: LightDM.Infographic
316 }318 }
319
320 Binding {
321 target: loader.item
322 property: "shellBorderWidth"
323 value: root.shellBorderWidth
324 }
317 }325 }
318326
319 Connections {327 Connections {
320328
=== modified file 'qml/Greeter/NarrowView.qml'
--- qml/Greeter/NarrowView.qml 2015-03-04 13:23:34 +0000
+++ qml/Greeter/NarrowView.qml 2015-07-02 16:54:47 +0000
@@ -22,6 +22,7 @@
22 id: root22 id: root
2323
24 property alias dragHandleLeftMargin: coverPage.dragHandleLeftMargin24 property alias dragHandleLeftMargin: coverPage.dragHandleLeftMargin
25 property alias shellBorderWidth: coverPage.shellBorderWidth
25 property alias launcherOffset: coverPage.launcherOffset26 property alias launcherOffset: coverPage.launcherOffset
26 property int currentIndex // unused27 property int currentIndex // unused
27 property alias delayMinutes: lockscreen.delayMinutes28 property alias delayMinutes: lockscreen.delayMinutes
2829
=== modified file 'qml/Launcher/Launcher.qml'
--- qml/Launcher/Launcher.qml 2015-04-15 20:21:11 +0000
+++ qml/Launcher/Launcher.qml 2015-07-02 16:54:47 +0000
@@ -30,6 +30,7 @@
3030
31 property int panelWidth: units.gu(8)31 property int panelWidth: units.gu(8)
32 property int dragAreaWidth: units.gu(1)32 property int dragAreaWidth: units.gu(1)
33 property int shellBorderWidth: 0
33 property int minimizeDistance: units.gu(26)34 property int minimizeDistance: units.gu(26)
34 property real progress: dragArea.dragging && dragArea.touchX > panelWidth ?35 property real progress: dragArea.dragging && dragArea.touchX > panelWidth ?
35 (width * (dragArea.touchX-panelWidth) / (width - panelWidth)) : 036 (width * (dragArea.touchX-panelWidth) / (width - panelWidth)) : 0
@@ -266,7 +267,7 @@
266 // we don't trigger both, the dragArea and the hoverArea267 // we don't trigger both, the dragArea and the hoverArea
267 MultiPointTouchArea {268 MultiPointTouchArea {
268 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }269 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
269 width: units.dp(1)270 width: units.dp(1) + root.shellBorderWidth
270 mouseEnabled: false271 mouseEnabled: false
271 enabled: parent.enabled272 enabled: parent.enabled
272 }273 }
@@ -279,7 +280,7 @@
279 direction: Direction.Rightwards280 direction: Direction.Rightwards
280281
281 enabled: root.available282 enabled: root.available
282 x: -root.x // so if launcher is adjusted relative to screen, we stay put (like tutorial does when teasing)283 x: -root.x - root.shellBorderWidth // so if launcher is adjusted relative to screen, we stay put (like tutorial does when teasing)
283 width: root.dragAreaWidth284 width: root.dragAreaWidth
284 height: root.height285 height: root.height
285286
286287
=== modified file 'qml/OrientedShell.qml'
--- qml/OrientedShell.qml 2015-07-02 16:54:47 +0000
+++ qml/OrientedShell.qml 2015-07-02 16:54:47 +0000
@@ -20,6 +20,7 @@
20import GSettings 1.020import GSettings 1.0
21import "Components"21import "Components"
22import "Rotation"22import "Rotation"
23import Ubuntu.Components 1.2
2324
24Rectangle {25Rectangle {
25 id: root26 id: root
@@ -28,6 +29,9 @@
28 implicitWidth: units.gu(40)29 implicitWidth: units.gu(40)
29 implicitHeight: units.gu(71)30 implicitHeight: units.gu(71)
3031
32 property real screenGuCount: root.width / units.gu(1)
33 property real usedGuCount: screenGuCount < 50 ? 40 : screenGuCount < 90 ? 50 : 90
34
31 // NB: native and primary orientations here don't map exactly to their QScreen counterparts35 // NB: native and primary orientations here don't map exactly to their QScreen counterparts
32 readonly property int nativeOrientation: width > height ? Qt.LandscapeOrientation : Qt.PortraitOrientation36 readonly property int nativeOrientation: width > height ? Qt.LandscapeOrientation : Qt.PortraitOrientation
3337
@@ -128,13 +132,15 @@
128 Shell {132 Shell {
129 id: shell133 id: shell
130 objectName: "shell"134 objectName: "shell"
131 width: root.width135 width: orientation == Qt.PortraitOrientation ? units.gu(root.usedGuCount) : root.width
132 height: root.height136 height: root.height
137 x: (root.width - width) / 2
133 orientation: root.angleToOrientation(orientationAngle)138 orientation: root.angleToOrientation(orientationAngle)
134 primaryOrientation: root.primaryOrientation139 primaryOrientation: root.primaryOrientation
135 nativeOrientation: root.nativeOrientation140 nativeOrientation: root.nativeOrientation
136 nativeWidth: root.width141 nativeWidth: root.width
137 nativeHeight: root.height142 nativeHeight: root.height
143 borderWidth: Math.max(0, shell.x)
138 mode: applicationArguments.mode144 mode: applicationArguments.mode
139145
140 // TODO: Factor in the connected input devices (eg: physical keyboard, mouse, touchscreen),146 // TODO: Factor in the connected input devices (eg: physical keyboard, mouse, touchscreen),
@@ -161,6 +167,20 @@
161 }167 }
162168
163 Rectangle {169 Rectangle {
170 id: leftBorder
171 color: "khaki"
172 anchors { top: root.top; bottom: root.bottom; left: root.left }
173 width: shell.x
174 z: 10000
175 }
176 Rectangle {
177 id: rightBorder
178 color: "khaki"
179 anchors { top: root.top; bottom: root.bottom; right: root.right }
180 width: shell.x
181 }
182
183 Rectangle {
164 id: shellCover184 id: shellCover
165 color: "black"185 color: "black"
166 anchors.fill: parent186 anchors.fill: parent
167187
=== modified file 'qml/Rotation/ImmediateRotationAction.qml'
--- qml/Rotation/ImmediateRotationAction.qml 2015-04-01 16:33:31 +0000
+++ qml/Rotation/ImmediateRotationAction.qml 2015-07-02 16:54:47 +0000
@@ -25,12 +25,15 @@
25 shell.orientationAngle = info.requestedOrientationAngle;25 shell.orientationAngle = info.requestedOrientationAngle;
26 shell.transformRotationAngle = info.requestedOrientationAngle;26 shell.transformRotationAngle = info.requestedOrientationAngle;
2727
28 var toPortrait = orientedShell.angleToOrientation(info.requestedOrientationAngle) == Qt.PortraitOrientation;
29 var usedWidth = toPortrait ? units.gu(orientedShell.usedGuCount) : orientedShell.width
30
28 // Making bindings as orientedShell's dimensions might wiggle during startup.31 // Making bindings as orientedShell's dimensions might wiggle during startup.
29 if (info.requestedOrientationAngle === 90 || info.requestedOrientationAngle === 270) {32 if (info.requestedOrientationAngle === 90 || info.requestedOrientationAngle === 270) {
30 shell.width = Qt.binding(function() { return orientedShell.height; });33 shell.width = Qt.binding(function() { return orientedShell.height; });
31 shell.height = Qt.binding(function() { return orientedShell.width; });34 shell.height = Qt.binding(function() { return orientedShell.width; });
32 } else {35 } else {
33 shell.width = Qt.binding(function() { return orientedShell.width; });36 shell.width = Qt.binding(function() { return usedWidth; });
34 shell.height = Qt.binding(function() { return orientedShell.height; });37 shell.height = Qt.binding(function() { return orientedShell.height; });
35 }38 }
3639
3740
=== modified file 'qml/Rotation/NinetyRotationAnimation.qml'
--- qml/Rotation/NinetyRotationAnimation.qml 2015-03-06 04:44:11 +0000
+++ qml/Rotation/NinetyRotationAnimation.qml 2015-07-02 16:54:47 +0000
@@ -15,6 +15,7 @@
15 */15 */
1616
17import QtQuick 2.317import QtQuick 2.3
18import Ubuntu.Components 1.2
1819
19SequentialAnimation {20SequentialAnimation {
20 id: root21 id: root
@@ -33,9 +34,11 @@
33 windowScreenshot.take();34 windowScreenshot.take();
34 windowScreenshot.visible = true;35 windowScreenshot.visible = true;
35 shell.orientationAngle = root.toAngle;36 shell.orientationAngle = root.toAngle;
36 shell.x = 0;37 var toPortrait = orientedShell.nativeOrientation == Qt.PortraitOrientation && orientedShell.angleToOrientation(toAngle) == Qt.PortraitOrientation;
37 shell.width = flipShellDimensions ? orientedShell.height : orientedShell.width;38 var usedWidth = toPortrait ? units.gu(orientedShell.usedGuCount) : orientedShell.width
38 shell.height = flipShellDimensions ? orientedShell.width : orientedShell.height;39 shell.x = toPortrait ? (orientedShell.width - usedWidth) / 2 : 0;
40 shell.width = flipShellDimensions ? orientedShell.height : (toPortrait ? usedWidth : orientedShell.width);
41 shell.height = flipShellDimensions ? (toPortrait ? usedWidth : orientedShell.width) : orientedShell.height;
39 shell.transformOriginX = orientedShell.width / 2;42 shell.transformOriginX = orientedShell.width / 2;
40 shell.transformOriginY = orientedShell.width / 2;43 shell.transformOriginY = orientedShell.width / 2;
41 shell.updateFocusedAppOrientation();44 shell.updateFocusedAppOrientation();
4245
=== modified file 'qml/Shell.qml'
--- qml/Shell.qml 2015-07-02 16:54:47 +0000
+++ qml/Shell.qml 2015-07-02 16:54:47 +0000
@@ -52,6 +52,7 @@
52 property int nativeOrientation52 property int nativeOrientation
53 property real nativeWidth53 property real nativeWidth
54 property real nativeHeight54 property real nativeHeight
55 property int borderWidth: 0
55 property alias indicatorAreaShowProgress: panel.indicatorAreaShowProgress56 property alias indicatorAreaShowProgress: panel.indicatorAreaShowProgress
56 property bool beingResized57 property bool beingResized
57 property string usageScenario: "phone" // supported values: "phone", "tablet" or "desktop"58 property string usageScenario: "phone" // supported values: "phone", "tablet" or "desktop"
@@ -352,6 +353,11 @@
352 property: "beingResized"353 property: "beingResized"
353 value: shell.beingResized354 value: shell.beingResized
354 }355 }
356 Binding {
357 target: applicationsDisplayLoader.item
358 property: "shellBorderWidth"
359 value: shell.borderWidth
360 }
355 }361 }
356362
357 Tutorial {363 Tutorial {
@@ -436,6 +442,7 @@
436 launcherOffset: launcher.progress442 launcherOffset: launcher.progress
437 forcedUnlock: tutorial.running443 forcedUnlock: tutorial.running
438 background: shell.background444 background: shell.background
445 shellBorderWidth: shell.borderWidth
439446
440 // avoid overlapping with Launcher's edge drag area447 // avoid overlapping with Launcher's edge drag area
441 // FIXME: Fix TouchRegistry & friends and remove this workaround448 // FIXME: Fix TouchRegistry & friends and remove this workaround
@@ -588,6 +595,7 @@
588 && !greeter.hasLockedApp595 && !greeter.hasLockedApp
589 inverted: shell.usageScenario !== "desktop"596 inverted: shell.usageScenario !== "desktop"
590 shadeBackground: !tutorial.running597 shadeBackground: !tutorial.running
598 shellBorderWidth: shell.borderWidth
591599
592 onShowDashHome: showHome()600 onShowDashHome: showHome()
593 onDash: showDash()601 onDash: showDash()
594602
=== modified file 'qml/Stages/PhoneStage.qml'
--- qml/Stages/PhoneStage.qml 2015-06-18 19:39:35 +0000
+++ qml/Stages/PhoneStage.qml 2015-07-02 16:54:47 +0000
@@ -42,6 +42,7 @@
42 property int nativeOrientation42 property int nativeOrientation
43 property real nativeWidth43 property real nativeWidth
44 property real nativeHeight44 property real nativeHeight
45 property int shellBorderWidth: 0
45 property bool beingResized: false46 property bool beingResized: false
46 onBeingResizedChanged: {47 onBeingResizedChanged: {
47 if (beingResized) {48 if (beingResized) {
@@ -561,7 +562,7 @@
561 direction: Direction.Leftwards562 direction: Direction.Leftwards
562 enabled: (spreadView.phase != 2 && root.spreadEnabled) || dragging563 enabled: (spreadView.phase != 2 && root.spreadEnabled) || dragging
563564
564 anchors { top: parent.top; right: parent.right; bottom: parent.bottom; rightMargin: -root.dragAreaOverlap }565 anchors { top: parent.top; right: parent.right; bottom: parent.bottom; rightMargin: -root.dragAreaOverlap - root.shellBorderWidth }
565 width: root.dragAreaWidth566 width: root.dragAreaWidth
566567
567 property var gesturePoints: new Array()568 property var gesturePoints: new Array()
568569
=== modified file 'qml/Stages/TabletStage.qml'
--- qml/Stages/TabletStage.qml 2015-06-18 19:39:35 +0000
+++ qml/Stages/TabletStage.qml 2015-07-02 16:54:47 +0000
@@ -42,6 +42,7 @@
42 property int nativeOrientation42 property int nativeOrientation
43 property real nativeWidth43 property real nativeWidth
44 property real nativeHeight44 property real nativeHeight
45 property int shellBorderWidth: 0
45 function updateFocusedAppOrientation() {46 function updateFocusedAppOrientation() {
46 var mainStageAppIndex = priv.indexOf(priv.mainStageAppId);47 var mainStageAppIndex = priv.indexOf(priv.mainStageAppId);
47 if (mainStageAppIndex >= 0 && mainStageAppIndex < spreadRepeater.count) {48 if (mainStageAppIndex >= 0 && mainStageAppIndex < spreadRepeater.count) {
@@ -730,10 +731,15 @@
730 enabled: spreadDragArea.dragging731 enabled: spreadDragArea.dragging
731 }732 }
732733
734 MouseArea {
735 anchors { top: parent.top; right: parent.right; bottom: parent.bottom; rightMargin: -root.shellBorderWidth }
736 width: root.shellBorderWidth
737 }
738
733 DirectionalDragArea {739 DirectionalDragArea {
734 id: spreadDragArea740 id: spreadDragArea
735 objectName: "spreadDragArea"741 objectName: "spreadDragArea"
736 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }742 anchors { top: parent.top; right: parent.right; bottom: parent.bottom; rightMargin: -root.shellBorderWidth }
737 width: root.dragAreaWidth743 width: root.dragAreaWidth
738 direction: Direction.Leftwards744 direction: Direction.Leftwards
739 enabled: (spreadView.phase != 2 && root.spreadEnabled) || dragging745 enabled: (spreadView.phase != 2 && root.spreadEnabled) || dragging

Subscribers

People subscribed via source and target branches