Merge lp:~saviq/unity8/initial-see-all into lp:unity8

Proposed by Michał Sawicz
Status: Merged
Approved by: Albert Astals Cid
Approved revision: 1060
Merged at revision: 1073
Proposed branch: lp:~saviq/unity8/initial-see-all
Merge into: lp:unity8
Prerequisite: lp:~saviq/unity8/drop-filtergrid
Diff against target: 310 lines (+97/-70)
4 files modified
po/unity8.pot (+17/-9)
qml/Dash/GenericScopeView.qml (+61/-39)
tests/autopilot/unity8/shell/emulators/dash.py (+1/-1)
tests/qmltests/Dash/tst_GenericScopeView.qml (+18/-21)
To merge this branch: bzr merge lp:~saviq/unity8/initial-see-all
Reviewer Review Type Date Requested Status
Albert Astals Cid (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Michal Hruby (community) Approve
Review via email: mp+226469@code.launchpad.net

Commit message

Move expansion button from section header to category footer.

Description of the change

 * Are there any related MPs required for this MP to build/function as expected? Please list.
https://code.launchpad.net/~saviq/unity8/drop-filtergrid/+merge/226415

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

 * If you changed the UI, has there been a design review?
Will do in silo.

To post a comment you must log in.
lp:~saviq/unity8/initial-see-all updated
1057. By Michał Sawicz

{}++

Revision history for this message
Michal Hruby (mhr3) wrote :

Saw a strange offset issue after collapsing a category, but I wasn't able to reproduce it since (not even sure whether it's this branch that introduces it).

Otherwise it's working fine.

review: Approve
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)
lp:~saviq/unity8/initial-see-all updated
1058. By Michał Sawicz

Merge trunk.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
lp:~saviq/unity8/initial-see-all updated
1059. By Michał Sawicz

Merge drop-filtergrid.

1060. By Michał Sawicz

Fix (or bring back to what they were before) the top/bottom gradients.

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
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Albert Astals Cid (aacid) wrote :

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

 * Did CI run pass? If not, please explain why.
No, weirdness in autopilot run

review: Approve
lp:~saviq/unity8/initial-see-all updated
1061. By Michał Sawicz

Merge drop-filtergrid.

1062. By Michał Sawicz

Fix emulator.

1063. By Michał Sawicz

Merge drop-filtergrid.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'po/unity8.pot'
2--- po/unity8.pot 2014-07-07 11:15:37 +0000
3+++ po/unity8.pot 2014-07-24 14:47:51 +0000
4@@ -8,7 +8,7 @@
5 msgstr ""
6 "Project-Id-Version: unity8\n"
7 "Report-Msgid-Bugs-To: \n"
8-"POT-Creation-Date: 2014-07-07 12:15+0100\n"
9+"POT-Creation-Date: 2014-07-11 14:59+0200\n"
10 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13@@ -80,10 +80,6 @@
14 msgid "OK"
15 msgstr ""
16
17-#: qml/Components/PageHeader.qml:366
18-msgid "Recent searches"
19-msgstr ""
20-
21 #: qml/Components/PassphraseLockscreen.qml:60
22 #, qt-format
23 msgid "Hello %1"
24@@ -105,7 +101,7 @@
25 msgid "See more"
26 msgstr ""
27
28-#: qml/Components/SeeMore.qml:58
29+#: qml/Components/SeeMore.qml:58 qml/Dash/GenericScopeView.qml:330
30 msgid "See less"
31 msgstr ""
32
33@@ -113,6 +109,10 @@
34 msgid "Recent"
35 msgstr ""
36
37+#: qml/Dash/GenericScopeView.qml:330
38+msgid "See all"
39+msgstr ""
40+
41 #: qml/Dash/Previews/PreviewActionCombo.qml:34
42 msgid "More..."
43 msgstr ""
44@@ -121,15 +121,15 @@
45 msgid "Less..."
46 msgstr ""
47
48-#: qml/Dash/Previews/PreviewRatingInput.qml:82
49+#: qml/Dash/Previews/PreviewRatingInput.qml:81
50 msgid "Rate this"
51 msgstr ""
52
53-#: qml/Dash/Previews/PreviewRatingInput.qml:128
54+#: qml/Dash/Previews/PreviewRatingInput.qml:126
55 msgid "Add a review"
56 msgstr ""
57
58-#: qml/Dash/Previews/PreviewRatingInput.qml:168
59+#: qml/Dash/Previews/PreviewRatingInput.qml:166
60 msgid "Send"
61 msgstr ""
62
63@@ -165,6 +165,14 @@
64 msgid "Please enter SIM PIN"
65 msgstr ""
66
67+#: qml/Panel/ActiveCallHint.qml:77
68+msgid "Tap to return to call..."
69+msgstr ""
70+
71+#: qml/Panel/ActiveCallHint.qml:90
72+msgid "Conference"
73+msgstr ""
74+
75 #: qml/Panel/Indicators/MenuItemFactory.qml:583
76 msgid "In queue…"
77 msgstr ""
78
79=== modified file 'qml/Dash/GenericScopeView.qml'
80--- qml/Dash/GenericScopeView.qml 2014-07-24 14:47:51 +0000
81+++ qml/Dash/GenericScopeView.qml 2014-07-24 14:47:51 +0000
82@@ -260,13 +260,13 @@
83 var shouldExpand = categoryId === categoryView.expandedCategoryId;
84 if (shouldExpand != baseItem.expanded) {
85 // If the filter animation will be seen start it, otherwise, just flip the switch
86- var shrinkingVisible = !shouldExpand && y + item.collapsedHeight < categoryView.height;
87+ var shrinkingVisible = !shouldExpand && y + item.collapsedHeight + seeAll.height < categoryView.height;
88 var growingVisible = shouldExpand && y + height < categoryView.height;
89 if (!previewListView.open || shouldExpand) {
90 var animate = shrinkingVisible || growingVisible;
91 baseItem.expand(shouldExpand, animate)
92 if (shouldExpand && !previewListView.open) {
93- categoryView.maximizeVisibleArea(index, item.expandedHeight);
94+ categoryView.maximizeVisibleArea(index, item.expandedHeight + seeAll.height);
95 }
96 }
97 }
98@@ -303,35 +303,68 @@
99 item.displayMarginEnd = -baseItem.height;
100 } else {
101 item.displayMarginBeginning = -Math.max(-baseItem.y, 0);
102- item.displayMarginEnd = -Math.max(baseItem.height - categoryView.height + baseItem.y, 0)
103+ item.displayMarginEnd = -Math.max(baseItem.height - seeAll.height
104+ - categoryView.height + baseItem.y, 0)
105 }
106 }
107 }
108-
109- Image {
110- visible: index != 0
111- anchors {
112- top: parent.top
113- left: parent.left
114- right: parent.right
115- }
116- fillMode: Image.Stretch
117- source: "graphics/dash_divider_top_lightgrad.png"
118- z: -1
119- }
120-
121- Image {
122- // FIXME Should not rely on model.count but view.count, but ListViewWithPageHeader doesn't expose it yet.
123- visible: index != categoryView.model.count - 1
124- anchors {
125- bottom: parent.bottom
126- left: parent.left
127- right: parent.right
128- }
129- fillMode: Image.Stretch
130- source: "graphics/dash_divider_top_darkgrad.png"
131- z: -1
132- }
133+ }
134+
135+ AbstractButton {
136+ id: seeAll
137+ objectName: "seeAll"
138+ anchors {
139+ top: rendererLoader.bottom
140+ left: parent.left
141+ right: parent.right
142+ }
143+ height: baseItem.expandable ? seeAllLabel.font.pixelSize + units.gu(6) : 0
144+
145+ onClicked: {
146+ if (categoryView.expandedCategoryId != baseItem.category) {
147+ categoryView.expandedCategoryId = baseItem.category;
148+ } else {
149+ categoryView.expandedCategoryId = "";
150+ }
151+ }
152+
153+ Label {
154+ id: seeAllLabel
155+ text: baseItem.expanded ? i18n.tr("See less") : i18n.tr("See all")
156+ anchors {
157+ centerIn: parent
158+ verticalCenterOffset: units.gu(-0.5)
159+ }
160+ fontSize: "small"
161+ font.weight: Font.Bold
162+ color: scopeStyle ? scopeStyle.foreground : "grey"
163+ visible: baseItem.expandable
164+ }
165+ }
166+
167+ Image {
168+ visible: index != 0
169+ anchors {
170+ top: parent.top
171+ left: parent.left
172+ right: parent.right
173+ }
174+ fillMode: Image.Stretch
175+ source: "graphics/dash_divider_top_lightgrad.png"
176+ z: -1
177+ }
178+
179+ Image {
180+ // FIXME Should not rely on model.count but view.count, but ListViewWithPageHeader doesn't expose it yet.
181+ visible: index != categoryView.model.count - 1
182+ anchors {
183+ bottom: seeAll.bottom
184+ left: parent.left
185+ right: parent.right
186+ }
187+ fillMode: Image.Stretch
188+ source: "graphics/dash_divider_top_darkgrad.png"
189+ z: -1
190 }
191 }
192
193@@ -342,17 +375,6 @@
194 width: categoryView.width
195 text: section
196 textColor: scopeStyle ? scopeStyle.foreground : "grey"
197- image: {
198- if (delegate && delegate.expandable)
199- return delegate.expanded ? "graphics/header_handlearrow2.png" : "graphics/header_handlearrow.png"
200- return "";
201- }
202- onClicked: {
203- if (categoryView.expandedCategoryId != delegate.category)
204- categoryView.expandedCategoryId = delegate.category;
205- else
206- categoryView.expandedCategoryId = "";
207- }
208 }
209
210 pageHeader: PageHeader {
211
212=== modified file 'tests/autopilot/unity8/shell/emulators/dash.py'
213--- tests/autopilot/unity8/shell/emulators/dash.py 2014-07-24 14:47:51 +0000
214+++ tests/autopilot/unity8/shell/emulators/dash.py 2014-07-24 14:47:51 +0000
215@@ -209,7 +209,7 @@
216
217 result = []
218 for card in application_cards:
219- if card.objectName != 'cardToolCard':
220+ if card.objectName not in ('cardToolCard', 'seeAll'):
221 result.append(card.title)
222 return result
223
224
225=== modified file 'tests/qmltests/Dash/tst_GenericScopeView.qml'
226--- tests/qmltests/Dash/tst_GenericScopeView.qml 2014-07-24 14:47:51 +0000
227+++ tests/qmltests/Dash/tst_GenericScopeView.qml 2014-07-24 14:47:51 +0000
228@@ -104,53 +104,50 @@
229 tryCompare(genericScopeView.scope, "searchQuery", "test")
230 }
231
232- function test_filter_expand_collapse() {
233+ function test_expand_collapse() {
234 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader0") != null; }, true);
235
236- var header = findChild(genericScopeView, "dashSectionHeader0")
237 var category = findChild(genericScopeView, "dashCategory0")
238+ var seeAll = findChild(category, "seeAll")
239
240- waitForRendering(header);
241+ waitForRendering(seeAll);
242 verify(category.expandable);
243 verify(!category.expanded);
244
245 var initialHeight = category.height;
246- var middleHeight;
247- mouseClick(header, header.width / 2, header.height / 2);
248- tryCompareFunction(function() { middleHeight = category.height; return category.height > initialHeight; }, true);
249- tryCompare(category, "expanded", true);
250- tryCompareFunction(function() { return category.height > middleHeight; }, true);
251+ mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
252+ verify(category.expanded);
253+ tryCompareFunction(function() { return category.height > initialHeight; }, true);
254
255- mouseClick(header, header.width / 2, header.height / 2);
256- verify(category.expandable);
257- tryCompare(category, "expanded", false);
258+ mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
259+ verify(!category.expanded);
260 }
261
262- function test_filter_expand_expand_collapse() {
263+ function test_expand_expand_collapse() {
264 // wait for the item to be there
265 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader2") != null; }, true);
266
267 var categoryListView = findChild(genericScopeView, "categoryListView");
268 categoryListView.contentY = categoryListView.height;
269
270- var header2 = findChild(genericScopeView, "dashSectionHeader2")
271 var category2 = findChild(genericScopeView, "dashCategory2")
272+ var seeAll2 = findChild(category2, "seeAll")
273
274- waitForRendering(header2);
275+ waitForRendering(seeAll2);
276 verify(category2.expandable);
277 verify(!category2.expanded);
278
279- mouseClick(header2, header2.width / 2, header2.height / 2);
280+ mouseClick(seeAll2, seeAll2.width / 2, seeAll2.height / 2);
281 tryCompare(category2, "expanded", true);
282
283 categoryListView.positionAtBeginning();
284
285- var header0 = findChild(genericScopeView, "dashSectionHeader0")
286 var category0 = findChild(genericScopeView, "dashCategory0")
287- mouseClick(header0, header0.width / 2, header0.height / 2);
288+ var seeAll0 = findChild(category0, "seeAll")
289+ mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
290 tryCompare(category0, "expanded", true);
291 tryCompare(category2, "expanded", false);
292- mouseClick(header0, header0.width / 2, header0.height / 2);
293+ mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
294 tryCompare(category0, "expanded", false);
295 tryCompare(category2, "expanded", false);
296 }
297@@ -163,11 +160,11 @@
298 shell.width = units.gu(20)
299 var categoryListView = findChild(genericScopeView, "categoryListView");
300 categoryListView.contentY = units.gu(20);
301- var header0 = findChild(genericScopeView, "dashSectionHeader0")
302- mouseClick(header0, header0.width / 2, header0.height / 2);
303+ var seeAll = findChild(category, "seeAll")
304+ mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
305 tryCompare(category, "expanded", true);
306 tryCompareFunction(function() { return category.item.height == genericScopeView.height - category.item.displayMarginBeginning - category.item.displayMarginEnd; }, true);
307- mouseClick(header0, header0.width / 2, header0.height / 2);
308+ mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
309 tryCompare(category, "expanded", false);
310 }
311

Subscribers

People subscribed via source and target branches