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

Proposed by Michael Zanetti on 2015-07-01
Status: Rejected
Rejected by: Albert Astals Cid on 2015-07-09
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) 2015-07-01 Disapprove on 2015-07-09
PS Jenkins bot (community) continuous-integration Needs Fixing on 2015-07-02
Daniel d'Andrada (community) Needs Fixing on 2015-07-01
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 on 2015-07-01
1836. By Michael Zanetti on 2015-07-01

revert bad change

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 on 2015-07-01
1837. By Michael Zanetti on 2015-07-01

fix greeter not being swipable from the edge

Daniel d'Andrada (dandrader) wrote :

Where's the checklist in the description?

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.

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 on 2015-07-02
1838. By Michael Zanetti on 2015-07-02

only use this weirdness when the native orientation is portrait

Albert Astals Cid (aacid) wrote :

Reject this for the moment?

review: Needs Information
Albert Astals Cid (aacid) :
review: Disapprove

Unmerged revisions

1838. By Michael Zanetti on 2015-07-02

only use this weirdness when the native orientation is portrait

1837. By Michael Zanetti on 2015-07-01

fix greeter not being swipable from the edge

1836. By Michael Zanetti on 2015-07-01

revert bad change

1835. By Michael Zanetti on 2015-07-01

fixes

1834. By Michael Zanetti on 2015-06-30

fix mouse event eater in launcher

1833. By Michael Zanetti on 2015-06-30

restrict viewport to 40, 50 or 90 gu

1832. By Michael Zanetti on 2015-06-29

merge orientedShellFixes

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Greeter/CoverPage.qml'
2--- qml/Greeter/CoverPage.qml 2015-05-11 14:36:03 +0000
3+++ qml/Greeter/CoverPage.qml 2015-07-02 16:54:47 +0000
4@@ -23,6 +23,7 @@
5 id: root
6
7 property real dragHandleLeftMargin
8+ property int shellBorderWidth: 0
9 property real launcherOffset
10 property alias background: greeterBackground.source
11 property real backgroundTopMargin
12@@ -132,6 +133,7 @@
13 objectName: "coverPageDragHandle"
14 anchors.fill: parent
15 anchors.leftMargin: root.dragHandleLeftMargin
16+ anchors.rightMargin: -root.shellBorderWidth
17 enabled: root.draggable
18 direction: Direction.Horizontal
19
20
21=== modified file 'qml/Greeter/Greeter.qml'
22--- qml/Greeter/Greeter.qml 2015-06-12 16:07:43 +0000
23+++ qml/Greeter/Greeter.qml 2015-07-02 16:54:47 +0000
24@@ -52,6 +52,8 @@
25 property int failedLoginsDelayAttempts: 7 // number of failed logins
26 property real failedLoginsDelayMinutes: 5 // minutes of forced waiting
27
28+ property int shellBorderWidth: 0
29+
30 readonly property bool animating: loader.item ? loader.item.animating : false
31
32 signal tease()
33@@ -314,6 +316,12 @@
34 property: "infographicModel"
35 value: LightDM.Infographic
36 }
37+
38+ Binding {
39+ target: loader.item
40+ property: "shellBorderWidth"
41+ value: root.shellBorderWidth
42+ }
43 }
44
45 Connections {
46
47=== modified file 'qml/Greeter/NarrowView.qml'
48--- qml/Greeter/NarrowView.qml 2015-03-04 13:23:34 +0000
49+++ qml/Greeter/NarrowView.qml 2015-07-02 16:54:47 +0000
50@@ -22,6 +22,7 @@
51 id: root
52
53 property alias dragHandleLeftMargin: coverPage.dragHandleLeftMargin
54+ property alias shellBorderWidth: coverPage.shellBorderWidth
55 property alias launcherOffset: coverPage.launcherOffset
56 property int currentIndex // unused
57 property alias delayMinutes: lockscreen.delayMinutes
58
59=== modified file 'qml/Launcher/Launcher.qml'
60--- qml/Launcher/Launcher.qml 2015-04-15 20:21:11 +0000
61+++ qml/Launcher/Launcher.qml 2015-07-02 16:54:47 +0000
62@@ -30,6 +30,7 @@
63
64 property int panelWidth: units.gu(8)
65 property int dragAreaWidth: units.gu(1)
66+ property int shellBorderWidth: 0
67 property int minimizeDistance: units.gu(26)
68 property real progress: dragArea.dragging && dragArea.touchX > panelWidth ?
69 (width * (dragArea.touchX-panelWidth) / (width - panelWidth)) : 0
70@@ -266,7 +267,7 @@
71 // we don't trigger both, the dragArea and the hoverArea
72 MultiPointTouchArea {
73 anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
74- width: units.dp(1)
75+ width: units.dp(1) + root.shellBorderWidth
76 mouseEnabled: false
77 enabled: parent.enabled
78 }
79@@ -279,7 +280,7 @@
80 direction: Direction.Rightwards
81
82 enabled: root.available
83- x: -root.x // so if launcher is adjusted relative to screen, we stay put (like tutorial does when teasing)
84+ x: -root.x - root.shellBorderWidth // so if launcher is adjusted relative to screen, we stay put (like tutorial does when teasing)
85 width: root.dragAreaWidth
86 height: root.height
87
88
89=== modified file 'qml/OrientedShell.qml'
90--- qml/OrientedShell.qml 2015-07-02 16:54:47 +0000
91+++ qml/OrientedShell.qml 2015-07-02 16:54:47 +0000
92@@ -20,6 +20,7 @@
93 import GSettings 1.0
94 import "Components"
95 import "Rotation"
96+import Ubuntu.Components 1.2
97
98 Rectangle {
99 id: root
100@@ -28,6 +29,9 @@
101 implicitWidth: units.gu(40)
102 implicitHeight: units.gu(71)
103
104+ property real screenGuCount: root.width / units.gu(1)
105+ property real usedGuCount: screenGuCount < 50 ? 40 : screenGuCount < 90 ? 50 : 90
106+
107 // NB: native and primary orientations here don't map exactly to their QScreen counterparts
108 readonly property int nativeOrientation: width > height ? Qt.LandscapeOrientation : Qt.PortraitOrientation
109
110@@ -128,13 +132,15 @@
111 Shell {
112 id: shell
113 objectName: "shell"
114- width: root.width
115+ width: orientation == Qt.PortraitOrientation ? units.gu(root.usedGuCount) : root.width
116 height: root.height
117+ x: (root.width - width) / 2
118 orientation: root.angleToOrientation(orientationAngle)
119 primaryOrientation: root.primaryOrientation
120 nativeOrientation: root.nativeOrientation
121 nativeWidth: root.width
122 nativeHeight: root.height
123+ borderWidth: Math.max(0, shell.x)
124 mode: applicationArguments.mode
125
126 // TODO: Factor in the connected input devices (eg: physical keyboard, mouse, touchscreen),
127@@ -161,6 +167,20 @@
128 }
129
130 Rectangle {
131+ id: leftBorder
132+ color: "khaki"
133+ anchors { top: root.top; bottom: root.bottom; left: root.left }
134+ width: shell.x
135+ z: 10000
136+ }
137+ Rectangle {
138+ id: rightBorder
139+ color: "khaki"
140+ anchors { top: root.top; bottom: root.bottom; right: root.right }
141+ width: shell.x
142+ }
143+
144+ Rectangle {
145 id: shellCover
146 color: "black"
147 anchors.fill: parent
148
149=== modified file 'qml/Rotation/ImmediateRotationAction.qml'
150--- qml/Rotation/ImmediateRotationAction.qml 2015-04-01 16:33:31 +0000
151+++ qml/Rotation/ImmediateRotationAction.qml 2015-07-02 16:54:47 +0000
152@@ -25,12 +25,15 @@
153 shell.orientationAngle = info.requestedOrientationAngle;
154 shell.transformRotationAngle = info.requestedOrientationAngle;
155
156+ var toPortrait = orientedShell.angleToOrientation(info.requestedOrientationAngle) == Qt.PortraitOrientation;
157+ var usedWidth = toPortrait ? units.gu(orientedShell.usedGuCount) : orientedShell.width
158+
159 // Making bindings as orientedShell's dimensions might wiggle during startup.
160 if (info.requestedOrientationAngle === 90 || info.requestedOrientationAngle === 270) {
161 shell.width = Qt.binding(function() { return orientedShell.height; });
162 shell.height = Qt.binding(function() { return orientedShell.width; });
163 } else {
164- shell.width = Qt.binding(function() { return orientedShell.width; });
165+ shell.width = Qt.binding(function() { return usedWidth; });
166 shell.height = Qt.binding(function() { return orientedShell.height; });
167 }
168
169
170=== modified file 'qml/Rotation/NinetyRotationAnimation.qml'
171--- qml/Rotation/NinetyRotationAnimation.qml 2015-03-06 04:44:11 +0000
172+++ qml/Rotation/NinetyRotationAnimation.qml 2015-07-02 16:54:47 +0000
173@@ -15,6 +15,7 @@
174 */
175
176 import QtQuick 2.3
177+import Ubuntu.Components 1.2
178
179 SequentialAnimation {
180 id: root
181@@ -33,9 +34,11 @@
182 windowScreenshot.take();
183 windowScreenshot.visible = true;
184 shell.orientationAngle = root.toAngle;
185- shell.x = 0;
186- shell.width = flipShellDimensions ? orientedShell.height : orientedShell.width;
187- shell.height = flipShellDimensions ? orientedShell.width : orientedShell.height;
188+ var toPortrait = orientedShell.nativeOrientation == Qt.PortraitOrientation && orientedShell.angleToOrientation(toAngle) == Qt.PortraitOrientation;
189+ var usedWidth = toPortrait ? units.gu(orientedShell.usedGuCount) : orientedShell.width
190+ shell.x = toPortrait ? (orientedShell.width - usedWidth) / 2 : 0;
191+ shell.width = flipShellDimensions ? orientedShell.height : (toPortrait ? usedWidth : orientedShell.width);
192+ shell.height = flipShellDimensions ? (toPortrait ? usedWidth : orientedShell.width) : orientedShell.height;
193 shell.transformOriginX = orientedShell.width / 2;
194 shell.transformOriginY = orientedShell.width / 2;
195 shell.updateFocusedAppOrientation();
196
197=== modified file 'qml/Shell.qml'
198--- qml/Shell.qml 2015-07-02 16:54:47 +0000
199+++ qml/Shell.qml 2015-07-02 16:54:47 +0000
200@@ -52,6 +52,7 @@
201 property int nativeOrientation
202 property real nativeWidth
203 property real nativeHeight
204+ property int borderWidth: 0
205 property alias indicatorAreaShowProgress: panel.indicatorAreaShowProgress
206 property bool beingResized
207 property string usageScenario: "phone" // supported values: "phone", "tablet" or "desktop"
208@@ -352,6 +353,11 @@
209 property: "beingResized"
210 value: shell.beingResized
211 }
212+ Binding {
213+ target: applicationsDisplayLoader.item
214+ property: "shellBorderWidth"
215+ value: shell.borderWidth
216+ }
217 }
218
219 Tutorial {
220@@ -436,6 +442,7 @@
221 launcherOffset: launcher.progress
222 forcedUnlock: tutorial.running
223 background: shell.background
224+ shellBorderWidth: shell.borderWidth
225
226 // avoid overlapping with Launcher's edge drag area
227 // FIXME: Fix TouchRegistry & friends and remove this workaround
228@@ -588,6 +595,7 @@
229 && !greeter.hasLockedApp
230 inverted: shell.usageScenario !== "desktop"
231 shadeBackground: !tutorial.running
232+ shellBorderWidth: shell.borderWidth
233
234 onShowDashHome: showHome()
235 onDash: showDash()
236
237=== modified file 'qml/Stages/PhoneStage.qml'
238--- qml/Stages/PhoneStage.qml 2015-06-18 19:39:35 +0000
239+++ qml/Stages/PhoneStage.qml 2015-07-02 16:54:47 +0000
240@@ -42,6 +42,7 @@
241 property int nativeOrientation
242 property real nativeWidth
243 property real nativeHeight
244+ property int shellBorderWidth: 0
245 property bool beingResized: false
246 onBeingResizedChanged: {
247 if (beingResized) {
248@@ -561,7 +562,7 @@
249 direction: Direction.Leftwards
250 enabled: (spreadView.phase != 2 && root.spreadEnabled) || dragging
251
252- anchors { top: parent.top; right: parent.right; bottom: parent.bottom; rightMargin: -root.dragAreaOverlap }
253+ anchors { top: parent.top; right: parent.right; bottom: parent.bottom; rightMargin: -root.dragAreaOverlap - root.shellBorderWidth }
254 width: root.dragAreaWidth
255
256 property var gesturePoints: new Array()
257
258=== modified file 'qml/Stages/TabletStage.qml'
259--- qml/Stages/TabletStage.qml 2015-06-18 19:39:35 +0000
260+++ qml/Stages/TabletStage.qml 2015-07-02 16:54:47 +0000
261@@ -42,6 +42,7 @@
262 property int nativeOrientation
263 property real nativeWidth
264 property real nativeHeight
265+ property int shellBorderWidth: 0
266 function updateFocusedAppOrientation() {
267 var mainStageAppIndex = priv.indexOf(priv.mainStageAppId);
268 if (mainStageAppIndex >= 0 && mainStageAppIndex < spreadRepeater.count) {
269@@ -730,10 +731,15 @@
270 enabled: spreadDragArea.dragging
271 }
272
273+ MouseArea {
274+ anchors { top: parent.top; right: parent.right; bottom: parent.bottom; rightMargin: -root.shellBorderWidth }
275+ width: root.shellBorderWidth
276+ }
277+
278 DirectionalDragArea {
279 id: spreadDragArea
280 objectName: "spreadDragArea"
281- anchors { top: parent.top; right: parent.right; bottom: parent.bottom }
282+ anchors { top: parent.top; right: parent.right; bottom: parent.bottom; rightMargin: -root.shellBorderWidth }
283 width: root.dragAreaWidth
284 direction: Direction.Leftwards
285 enabled: (spreadView.phase != 2 && root.spreadEnabled) || dragging

Subscribers

People subscribed via source and target branches