Merge lp:~cimi/unity8/redesign-pinned-apps into lp:unity8

Proposed by Andrea Cimitan
Status: Merged
Approved by: Michael Zanetti
Approved revision: 1337
Merged at revision: 1347
Proposed branch: lp:~cimi/unity8/redesign-pinned-apps
Merge into: lp:unity8
Diff against target: 175 lines (+26/-47)
3 files modified
qml/Launcher/LauncherDelegate.qml (+20/-33)
qml/Launcher/LauncherPanel.qml (+5/-14)
tests/mocks/Unity/Launcher/MockLauncherModel.cpp (+1/-0)
To merge this branch: bzr merge lp:~cimi/unity8/redesign-pinned-apps
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+237371@code.launchpad.net

Commit message

Redesign for pinned apps. Remove thindivider on top of ubuntu dash button (not needed anymore)

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
no
 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes
 * Did you make sure that your branch does not contain spurious tags?
Yes
 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
n/a
 * If you changed the UI, has there been a design review?
y

To post a comment you must log in.
lp:~cimi/unity8/redesign-pinned-apps updated
1336. By Andrea Cimitan

Default is antialiasing true for radius rectangles

Revision history for this message
Michael Zanetti (mzanetti) wrote :

This doesn't work yet, the count emblem hides the pinned bubble. In my last design hangout I asked how to deal with that and there wasn't yet an answer for this. Vesa told me not to move the count emblem to the right as one of the design mockups suggests. So I think this is not ready to land yet.

review: Needs Fixing
Revision history for this message
Michael Zanetti (mzanetti) wrote :

Also, I'm getting this warning:

QQuickShaderEffect: 'clipCorner' does not have a matching property!

review: Needs Fixing
Revision history for this message
Michael Zanetti (mzanetti) wrote :

Had a chat with design. Let's just shorten the count emblem to not overlap with the pinned dot. There should be half a grid unit spacing between the dot and the longest count emblem.

Revision history for this message
Michael Zanetti (mzanetti) wrote :

Please update the MockLauncherModel to hold a pinned item with a very long count emblem so we can easily see that case in tryLauncher

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~cimi/unity8/redesign-pinned-apps updated
1337. By Andrea Cimitan

Requested design changes

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

 * 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.

no. because Autopilot.

 * Did you make sure that the branch does not contain spurious tags?

yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'qml/Launcher/LauncherDelegate.qml'
2--- qml/Launcher/LauncherDelegate.qml 2014-09-03 13:30:52 +0000
3+++ qml/Launcher/LauncherDelegate.qml 2014-10-07 11:11:40 +0000
4@@ -27,7 +27,7 @@
5 property bool itemFocused: false
6 property real maxAngle: 0
7 property bool inverted: false
8- property bool clipCorner: false
9+ property alias pinned: pin.visible
10
11 readonly property int effectiveHeight: Math.cos(angle * Math.PI / 180) * itemHeight
12 readonly property real foldedHeight: Math.cos(maxAngle * Math.PI / 180) * itemHeight
13@@ -71,14 +71,31 @@
14 height: root.itemHeight - units.gu(1)
15 }
16
17+ Rectangle {
18+ id: pin
19+ anchors {
20+ left: iconShape.left
21+ top: iconShape.top
22+ topMargin: -units.dp(2)
23+ }
24+ width: units.gu(1)
25+ height: width
26+ radius: width / 2
27+ color: "white"
28+ }
29+
30 UbuntuShape {
31+ id: countEmblem
32 objectName: "countEmblem"
33+
34+ readonly property real pinMargin: pin.visible ? pin.width + units.gu(1) - anchors.leftMargin : 0
35+
36 anchors {
37 right: parent.right
38 top: parent.top
39 margins: units.dp(3)
40 }
41- width: Math.min(root.itemWidth, Math.max(units.gu(2), countLabel.implicitWidth + units.gu(1)))
42+ width: Math.min(root.itemWidth - pinMargin, Math.max(units.gu(2), countLabel.implicitWidth + units.gu(1)))
43 height: units.gu(2)
44 color: UbuntuColors.orange
45 visible: root.countVisible
46@@ -92,7 +109,7 @@
47 // FIXME: verticalCenter seems to be off wee bit and QML doesn't have a centerLine
48 // property for Text: https://bugreports.qt-project.org/browse/QTBUG-40479
49 anchors.verticalCenterOffset: -units.dp(.5)
50- width: root.itemWidth - units.gu(1)
51+ width: root.itemWidth - units.gu(1) - countEmblem.pinMargin
52 horizontalAlignment: Text.AlignHCenter
53 elide: Text.ElideRight
54 color: "white"
55@@ -149,24 +166,6 @@
56 }
57 }
58
59- Item {
60- id: clipper
61- anchors.centerIn: parent
62- width: iconItem.width
63- height: iconItem.height
64- Rectangle {
65- anchors {
66- fill: parent
67- topMargin: -units.gu(2)
68- leftMargin: -units.gu(2)
69- rightMargin: -units.gu(2)
70- bottomMargin: units.gu(1.2)
71- }
72- color: "red"
73- rotation: root.rotation + 45
74- }
75- }
76-
77 ShaderEffect {
78 id: transformEffect
79 anchors.centerIn: parent
80@@ -176,7 +175,6 @@
81 property real itemOpacity: root.itemOpacity
82 property real brightness: Math.max(-1, root.brightness)
83 property real angle: root.angle
84- property bool clipCorner: root.clipCorner
85 rotation: root.inverted ? 180 : 0
86
87 property variant source: ShaderEffectSource {
88@@ -185,11 +183,6 @@
89 hideSource: true
90 }
91
92- property var mask: ShaderEffectSource {
93- sourceItem: clipper
94- hideSource: true
95- }
96-
97 transform: [
98 // Rotating 3 times at top/bottom because that increases the perspective.
99 // This is a hack, but as QML does not support real 3D coordinates
100@@ -224,19 +217,13 @@
101 fragmentShader: "
102 varying highp vec2 qt_TexCoord0;
103 uniform sampler2D source;
104- uniform sampler2D mask;
105 uniform lowp float brightness;
106 uniform lowp float itemOpacity;
107- uniform bool clipCorner;
108 void main(void)
109 {
110 highp vec4 sourceColor = texture2D(source, qt_TexCoord0);
111- highp vec4 maskColor = texture2D(mask, qt_TexCoord0);
112 sourceColor.rgb = mix(sourceColor.rgb, vec3(step(0.0, brightness)), abs(brightness));
113 sourceColor *= itemOpacity;
114- if (clipCorner) {
115- sourceColor *= maskColor.a;
116- }
117 gl_FragColor = sourceColor;
118 }"
119 }
120
121=== modified file 'qml/Launcher/LauncherPanel.qml'
122--- qml/Launcher/LauncherPanel.qml 2014-08-26 11:34:22 +0000
123+++ qml/Launcher/LauncherPanel.qml 2014-10-07 11:11:40 +0000
124@@ -65,15 +65,6 @@
125 }
126 }
127
128- ThinDivider {
129- anchors {
130- left: parent.left
131- right: parent.right
132- margins: -mainColumn.anchors.leftMargin
133- }
134- rotation: root.rotation
135- }
136-
137 Item {
138 anchors.left: parent.left
139 anchors.right: parent.right
140@@ -158,7 +149,7 @@
141 count: model.count
142 countVisible: model.countVisible
143 progress: model.progress
144- clipCorner: model.pinned
145+ pinned: model.pinned
146 itemFocused: model.focused
147 inverted: root.inverted
148 z: -Math.abs(offset)
149@@ -469,10 +460,10 @@
150 width: itemWidth
151 rotation: root.rotation
152 itemOpacity: 0.9
153- clipCorner: dndArea.draggedIndex > -1 &&
154- LauncherModel.get(dndArea.draggedIndex).pinned &&
155- !dndArea.preDragging &&
156- !dndArea.dragging
157+ pinned: dndArea.draggedIndex > -1 &&
158+ LauncherModel.get(dndArea.draggedIndex).pinned &&
159+ !dndArea.preDragging &&
160+ !dndArea.dragging
161
162 function flatten() {
163 fakeDragItemAnimation.start();
164
165=== modified file 'tests/mocks/Unity/Launcher/MockLauncherModel.cpp'
166--- tests/mocks/Unity/Launcher/MockLauncherModel.cpp 2014-09-03 13:33:21 +0000
167+++ tests/mocks/Unity/Launcher/MockLauncherModel.cpp 2014-10-07 11:11:40 +0000
168@@ -54,6 +54,7 @@
169 item = new MockLauncherItem("ubuntu-weather-app", "/usr/share/applications/ubuntu-weather-app.desktop", "Weather", "weather", this);
170 item->setCount(1234567890);
171 item->setCountVisible(true);
172+ item->setPinned(true);
173 m_list.append(item);
174 item = new MockLauncherItem("notes-app", "/usr/share/applications/notes-app.desktop", "Notepad", "notepad", this);
175 item->setProgress(50);

Subscribers

People subscribed via source and target branches