Merge lp:~mzanetti/unity8/spread-fixes into lp:unity8

Proposed by Michael Zanetti on 2016-11-07
Status: Superseded
Proposed branch: lp:~mzanetti/unity8/spread-fixes
Merge into: lp:unity8
Diff against target: 253 lines (+59/-16)
5 files modified
qml/Components/BlurLayer.qml (+9/-5)
qml/Shell.qml (+2/-1)
qml/Stage/Spread/Spread.qml (+1/-1)
qml/Stage/Spread/SpreadDelegateInputArea.qml (+7/-1)
qml/Stage/Stage.qml (+40/-8)
To merge this branch: bzr merge lp:~mzanetti/unity8/spread-fixes
Reviewer Review Type Date Requested Status
Lukáš Tinkl (community) 2016-11-07 Approve on 2016-11-07
Unity8 CI Bot continuous-integration Needs Fixing on 2016-11-07
Review via email: mp+310187@code.launchpad.net

This proposal has been superseded by a proposal from 2016-11-08.

Commit Message

Fixes in the spread after design review

- add a minimum width for the tile info to prevent it going to ...
- tiles should not be interactive any more when moving to spread
- add some resistance to the drag when an app is not closeable
- allow rotating when there is no app focused
- add a fade in animation to the icons in the spread
- fix spread looking out of place when there's only one item

Description of the Change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
nope
 * Did you perform an exploratory manual test run of your code change and any related functionality?
yip yip
 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
nope
 * If you changed the UI, has there been a design review?
yip yip

To post a comment you must log in.
Lukáš Tinkl (lukas-kde) wrote :

Nice, looks good

* Did you perform an exploratory manual test run of the code change and any related functionality?

Yes

* Did CI run pass? If not, please explain why.

Not yet, dunno why, will wait with top approval

review: Approve
Unity8 CI Bot (unity8-ci-bot) wrote :

FAILED: Continuous integration, rev:2680
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2471/
Executed test runs:
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build/3258
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=qmluitests.sh/1865
    UNSTABLE: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=qmluitests.sh/1865
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/test-0-autopkgtest/label=amd64,release=zesty,testname=qmluitests.sh/1865
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-0-fetch/3286
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3140
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=vivid+overlay/3140/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3140
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=xenial+overlay/3140/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3140
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=amd64,release=zesty/3140/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3140
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=vivid+overlay/3140/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3140
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=xenial+overlay/3140/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3140
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=armhf,release=zesty/3140/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3140
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=vivid+overlay/3140/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3140
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=xenial+overlay/3140/artifact/output/*zip*/output.zip
    SUCCESS: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3140
        deb: https://unity8-jenkins.ubuntu.com/job/build-2-binpkg/arch=i386,release=zesty/3140/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://unity8-jenkins.ubuntu.com/job/lp-unity8-ci/2471/rebuild

review: Needs Fixing (continuous-integration)
Lukáš Tinkl (lukas-kde) wrote :

CI is fine, unrelated failures, passes locally just fine

review: Approve
lp:~mzanetti/unity8/spread-fixes updated on 2016-11-07
2681. By Michael Zanetti on 2016-11-07

cleanup warning, add a comment on why

2682. By Michael Zanetti on 2016-11-07

resetting the spread position should happen on tablet too

2683. By Michael Zanetti on 2016-11-07

always close the spread on left edge swipe

2684. By Michael Zanetti on 2016-11-07

nicer code

Lukáš Tinkl (lukas-kde) wrote :

Yup, still looking good; if design wants to get these fixes in, I'm fine with it

review: Approve
lp:~mzanetti/unity8/spread-fixes updated on 2016-11-09
2685. By Michael Zanetti on 2016-11-08

merge with spread-blur

2686. By Michael Zanetti on 2016-11-09

merge prereq

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Components/BlurLayer.qml'
2--- qml/Components/BlurLayer.qml 2015-09-18 11:39:22 +0000
3+++ qml/Components/BlurLayer.qml 2016-11-08 11:03:07 +0000
4@@ -21,8 +21,9 @@
5 id: root
6
7 property alias source: shaderEffectSource.sourceItem
8- property alias saturation: desaturateEffect.saturationValue
9- property alias blurRadius: fastBlur.radius
10+ property real saturation: 1
11+ property real brightness: 1
12+ property real blurRadius: 0
13
14 readonly property alias ready: shaderEffectSource.ready
15
16@@ -30,7 +31,8 @@
17 id: desaturateEffect
18 anchors.fill: root
19
20- property real saturationValue: 1
21+ property real saturationValue: Math.min(Math.max(root.saturation, 0), 1)
22+ property real brightnessValue: Math.min(Math.max(root.brightness, 0), 1)
23
24 property variant source: ShaderEffectSource {
25 id: shaderEffectSource
26@@ -50,12 +52,14 @@
27 varying highp vec2 qt_TexCoord0;
28 uniform sampler2D source;
29 uniform lowp float saturationValue;
30+ uniform lowp float brightnessValue;
31 void main(void)
32 {
33 highp vec4 sourceColor = texture2D(source, qt_TexCoord0);
34 highp vec4 scaledColor = sourceColor * vec4(0.3, 0.59, 0.11, 1.0);
35 lowp float luminance = scaledColor.r + scaledColor.g + scaledColor.b ;
36- gl_FragColor = mix(vec4(luminance, luminance, luminance, sourceColor.a), sourceColor, saturationValue);
37+ highp vec4 tmp = mix(vec4(luminance, luminance, luminance, sourceColor.a), sourceColor, saturationValue);
38+ gl_FragColor = mix(vec4(0, 0, 0, 1), tmp, brightnessValue);
39 }"
40 }
41
42@@ -64,6 +68,6 @@
43 anchors.fill: parent
44 source: desaturateEffect
45 visible: radius > 0
46- radius: 0
47+ radius: Math.max(root.blurRadius, 0)
48 }
49 }
50
51=== modified file 'qml/Shell.qml'
52--- qml/Shell.qml 2016-10-03 11:15:27 +0000
53+++ qml/Shell.qml 2016-11-08 11:03:07 +0000
54@@ -442,9 +442,10 @@
55 }
56
57 if (!greeter.locked && tutorial.launcherLongSwipeEnabled
58- && ApplicationManager.focusedApplicationId != "unity8-dash") {
59+ && (ApplicationManager.focusedApplicationId != "unity8-dash" || stage.spreadShown)) {
60 ApplicationManager.requestFocusApplication("unity8-dash")
61 launcher.fadeOut();
62+ stage.closeSpread();
63 }
64 }
65
66
67=== modified file 'qml/Stage/Spread/Spread.qml'
68--- qml/Stage/Spread/Spread.qml 2016-09-20 12:03:51 +0000
69+++ qml/Stage/Spread/Spread.qml 2016-11-08 11:03:07 +0000
70@@ -91,7 +91,7 @@
71
72 readonly property real visibleItemCount: (spreadWidth / spreadItemWidth) / (1 - itemOverlap)
73
74- readonly property real spreadTotalWidth: totalItemCount * spreadWidth / visibleItemCount
75+ readonly property real spreadTotalWidth: Math.max(2,totalItemCount) * spreadWidth / visibleItemCount
76
77 readonly property real centeringOffset: Math.max(spreadWidth - spreadTotalWidth ,0) / (2 * spreadWidth)
78
79
80=== modified file 'qml/Stage/Spread/SpreadDelegateInputArea.qml'
81--- qml/Stage/Spread/SpreadDelegateInputArea.qml 2016-10-11 21:48:40 +0000
82+++ qml/Stage/Spread/SpreadDelegateInputArea.qml 2016-11-08 11:03:07 +0000
83@@ -119,7 +119,13 @@
84 }
85 }
86
87- d.distance = tp.y - tp.startY - offset
88+ if (root.closeable) {
89+ d.distance = tp.y - tp.startY - offset
90+ } else {
91+ var value = tp.y - tp.startY - offset;
92+ d.distance = Math.sqrt(Math.abs(value)) * (value < 0 ? -1 : 1) * 3
93+ }
94+
95 d.pushDragEvent(tp);
96 }
97
98
99=== modified file 'qml/Stage/Stage.qml'
100--- qml/Stage/Stage.qml 2016-10-24 11:34:20 +0000
101+++ qml/Stage/Stage.qml 2016-11-08 11:03:07 +0000
102@@ -53,18 +53,18 @@
103 property real leftEdgeDragProgress: 0
104
105 // Used by the tutorial code
106- readonly property bool spreadShown: state == "spread"
107- readonly property real rightEdgeDragProgress: rightEdgeDragArea.progress // How far left the stage has been dragged
108+ readonly property real rightEdgeDragProgress: rightEdgeDragArea.dragging ? rightEdgeDragArea.progress : 0 // How far left the stage has been dragged
109
110 // used by the snap windows (edge maximize) feature
111 readonly property alias previewRectangle: fakeRectangle
112
113+ readonly property bool spreadShown: state == "spread"
114 readonly property var mainApp: priv.focusedAppDelegate ? priv.focusedAppDelegate.application : null
115
116 // application windows never rotate independently
117 property int mainAppWindowOrientationAngle: shellOrientationAngle
118
119- property bool orientationChangesEnabled: priv.focusedAppDelegate && priv.focusedAppDelegate.orientationChangesEnabled
120+ property bool orientationChangesEnabled: !priv.focusedAppDelegate || priv.focusedAppDelegate.orientationChangesEnabled
121
122 property int supportedOrientations: {
123 if (mainApp) {
124@@ -105,9 +105,13 @@
125 edgeBarrier.push(amount);
126 }
127
128+ function closeSpread() {
129+ priv.goneToSpread = false;
130+ }
131+
132 onSpreadEnabledChanged: {
133- if (!spreadEnabled && root.state == "spread") {
134- priv.goneToSpread = false;
135+ if (!spreadEnabled && spreadShown) {
136+ closeSpread();
137 }
138 }
139
140@@ -409,12 +413,20 @@
141 PropertyChanges { target: hoverMouseArea; enabled: true }
142 PropertyChanges { target: rightEdgeDragArea; enabled: false }
143 PropertyChanges { target: cancelSpreadMouseArea; enabled: true }
144+ PropertyChanges { target: blurLayer; visible: true; blurRadius: 32; brightness: .65 }
145 },
146 State {
147 name: "stagedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "staged"
148+ PropertyChanges {
149+ target: blurLayer;
150+ visible: true;
151+ blurRadius: 32
152+ brightness: MathUtils.linearAnimation(spreadItem.rightEdgeBreakPoint, 1, 0, .65, Math.max(rightEdgeDragArea.progress, edgeBarrier.progress))
153+ }
154 },
155 State {
156 name: "sideStagedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "stagedWithSideStage"
157+ extend: "stagedRightEdge"
158 PropertyChanges {
159 target: sideStage
160 opacity: priv.sideStageDelegate.x === sideStage.x ? 1 : 0
161@@ -423,9 +435,16 @@
162 },
163 State {
164 name: "windowedRightEdge"; when: (rightEdgeDragArea.dragging || edgeBarrier.progress > 0) && root.mode == "windowed"
165+ PropertyChanges {
166+ target: blurLayer;
167+ visible: true
168+ blurRadius: MathUtils.linearAnimation(spreadItem.rightEdgeBreakPoint, 1, 0, 32, Math.max(rightEdgeDragArea.progress, edgeBarrier.progress))
169+ brightness: MathUtils.linearAnimation(spreadItem.rightEdgeBreakPoint, 1, 1, .65, Math.max(rightEdgeDragArea.progress, edgeBarrier.progress))
170+ }
171 },
172 State {
173 name: "staged"; when: root.mode === "staged"
174+ PropertyChanges { target: wallpaper; visible: false }
175 },
176 State {
177 name: "stagedWithSideStage"; when: root.mode === "stagedWithSideStage"
178@@ -440,6 +459,7 @@
179 Transition {
180 from: "stagedRightEdge,sideStagedRightEdge,windowedRightEdge"; to: "spread"
181 PropertyAction { target: spreadItem; property: "highlightedIndex"; value: -1 }
182+ PropertyAnimation { target: blurLayer; properties: "brightness,blurRadius"; duration: priv.animationDuration }
183 },
184 Transition {
185 to: "spread"
186@@ -462,7 +482,7 @@
187 }
188 },
189 Transition {
190- to: "stagedRightEdge"
191+ to: "stagedRightEdge,sideStagedRightEdge"
192 PropertyAction { target: floatingFlickable; property: "contentX"; value: 0 }
193 },
194 Transition {
195@@ -494,6 +514,13 @@
196 z: -2
197 }
198
199+ BlurLayer {
200+ id: blurLayer
201+ anchors.fill: parent
202+ source: wallpaper
203+ visible: false
204+ }
205+
206 Spread {
207 id: spreadItem
208 objectName: "spreadItem"
209@@ -1052,6 +1079,7 @@
210 showHighlight: spreadItem.highlightedIndex === index
211 darkening: spreadItem.highlightedIndex >= 0
212 anchors.topMargin: dragArea.distance
213+ interactive: false
214 }
215 PropertyChanges {
216 target: appDelegate
217@@ -1091,7 +1119,10 @@
218 scaleToPreviewSize: spreadItem.stackHeight
219 scaleToPreviewProgress: stagedRightEdgeMaths.scaleToPreviewProgress
220 shadowOpacity: .3
221+ interactive: false
222 }
223+ // make sure it's visible but transparent so it fades in when we transition to spread
224+ PropertyChanges { target: windowInfoItem; opacity: 0; visible: true }
225 },
226 State {
227 name: "windowedRightEdge"
228@@ -1350,6 +1381,7 @@
229 PropertyAction { target: decoratedWindow; property: "scaleToPreviewSize" }
230 UbuntuNumberAnimation { target: appDelegate; properties: "x,y,height"; duration: priv.animationDuration }
231 UbuntuNumberAnimation { target: decoratedWindow; properties: "width,height,itemScale,angle,scaleToPreviewProgress"; duration: priv.animationDuration }
232+ UbuntuNumberAnimation { target: windowInfoItem; properties: "opacity"; duration: priv.animationDuration }
233 },
234 Transition {
235 from: "normal,staged"; to: "stagedWithSideStage"
236@@ -1562,7 +1594,7 @@
237 maxWidth: {
238 var nextApp = appRepeater.itemAt(index + 1);
239 if (nextApp) {
240- return nextApp.x - appDelegate.x - units.gu(1)
241+ return Math.max(iconHeight, nextApp.x - appDelegate.x - units.gu(1))
242 }
243 return appDelegate.width;
244 }
245@@ -1730,7 +1762,7 @@
246 property var gesturePoints: []
247 property bool cancelled: false
248
249- property real progress: dragging ? -touchPosition.x / root.width : 0
250+ property real progress: -touchPosition.x / root.width
251 onProgressChanged: {
252 if (dragging) {
253 draggedProgress = progress;

Subscribers

People subscribed via source and target branches