on xenial help sign in
Move expansion button from section header to category footer. Fixes: 1261300
6097094Michał Sawicz
po/unity8.pot+17−9
@@ -8,7 +8,7 @@ msgid ""
8msgstr ""
8msgstr ""
9"Project-Id-Version: unity8\n"
9"Project-Id-Version: unity8\n"
10"Report-Msgid-Bugs-To: \n"
10"Report-Msgid-Bugs-To: \n"
11−"POT-Creation-Date: 2014-07-07 12:15+0100\n"
11+"POT-Creation-Date: 2014-07-11 14:59+0200\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -80,10 +80,6 @@ msgstr ""
80msgid "OK"
80msgid "OK"
81msgstr ""
81msgstr ""
82
82
83−#: qml/Components/PageHeader.qml:366
84−msgid "Recent searches"
85−msgstr ""
86−
87#: qml/Components/PassphraseLockscreen.qml:60
83#: qml/Components/PassphraseLockscreen.qml:60
88#, qt-format
84#, qt-format
89msgid "Hello %1"
85msgid "Hello %1"
@@ -105,7 +101,7 @@ msgstr ""
105msgid "See more"
101msgid "See more"
106msgstr ""
102msgstr ""
107
103
108−#: qml/Components/SeeMore.qml:58
104+#: qml/Components/SeeMore.qml:58 qml/Dash/GenericScopeView.qml:330
109msgid "See less"
105msgid "See less"
110msgstr ""
106msgstr ""
111
107
@@ -113,6 +109,10 @@ msgstr ""
113msgid "Recent"
109msgid "Recent"
114msgstr ""
110msgstr ""
115
111
112+#: qml/Dash/GenericScopeView.qml:330
113+msgid "See all"
114+msgstr ""
115+
116#: qml/Dash/Previews/PreviewActionCombo.qml:34
116#: qml/Dash/Previews/PreviewActionCombo.qml:34
117msgid "More..."
117msgid "More..."
118msgstr ""
118msgstr ""
@@ -121,15 +121,15 @@ msgstr ""
121msgid "Less..."
121msgid "Less..."
122msgstr ""
122msgstr ""
123
123
124−#: qml/Dash/Previews/PreviewRatingInput.qml:82
124+#: qml/Dash/Previews/PreviewRatingInput.qml:81
125msgid "Rate this"
125msgid "Rate this"
126msgstr ""
126msgstr ""
127
127
128−#: qml/Dash/Previews/PreviewRatingInput.qml:128
128+#: qml/Dash/Previews/PreviewRatingInput.qml:126
129msgid "Add a review"
129msgid "Add a review"
130msgstr ""
130msgstr ""
131
131
132−#: qml/Dash/Previews/PreviewRatingInput.qml:168
132+#: qml/Dash/Previews/PreviewRatingInput.qml:166
133msgid "Send"
133msgid "Send"
134msgstr ""
134msgstr ""
135
135
@@ -165,6 +165,14 @@ msgstr ""
165msgid "Please enter SIM PIN"
165msgid "Please enter SIM PIN"
166msgstr ""
166msgstr ""
167
167
168+#: qml/Panel/ActiveCallHint.qml:77
169+msgid "Tap to return to call..."
170+msgstr ""
171+
172+#: qml/Panel/ActiveCallHint.qml:90
173+msgid "Conference"
174+msgstr ""
175+
168#: qml/Panel/Indicators/MenuItemFactory.qml:583
176#: qml/Panel/Indicators/MenuItemFactory.qml:583
169msgid "In queue…"
177msgid "In queue…"
170msgstr ""
178msgstr ""
qml/Dash/GenericScopeView.qml+54−32
@@ -260,13 +260,13 @@ FocusScope {
260 var shouldExpand = categoryId === categoryView.expandedCategoryId;
260 var shouldExpand = categoryId === categoryView.expandedCategoryId;
261 if (shouldExpand != baseItem.expanded) {
261 if (shouldExpand != baseItem.expanded) {
262 // If the filter animation will be seen start it, otherwise, just flip the switch
262 // If the filter animation will be seen start it, otherwise, just flip the switch
263− var shrinkingVisible = !shouldExpand && y + item.collapsedHeight < categoryView.height;
263+ var shrinkingVisible = !shouldExpand && y + item.collapsedHeight + seeAll.height < categoryView.height;
264 var growingVisible = shouldExpand && y + height < categoryView.height;
264 var growingVisible = shouldExpand && y + height < categoryView.height;
265 if (!previewListView.open || shouldExpand) {
265 if (!previewListView.open || shouldExpand) {
266 var animate = shrinkingVisible || growingVisible;
266 var animate = shrinkingVisible || growingVisible;
267 baseItem.expand(shouldExpand, animate)
267 baseItem.expand(shouldExpand, animate)
268 if (shouldExpand && !previewListView.open) {
268 if (shouldExpand && !previewListView.open) {
269− categoryView.maximizeVisibleArea(index, item.expandedHeight);
269+ categoryView.maximizeVisibleArea(index, item.expandedHeight + seeAll.height);
270 }
270 }
271 }
271 }
272 }
272 }
@@ -303,36 +303,69 @@ FocusScope {
303 item.displayMarginEnd = -baseItem.height;
303 item.displayMarginEnd = -baseItem.height;
304 } else {
304 } else {
305 item.displayMarginBeginning = -Math.max(-baseItem.y, 0);
305 item.displayMarginBeginning = -Math.max(-baseItem.y, 0);
306− item.displayMarginEnd = -Math.max(baseItem.height - categoryView.height + baseItem.y, 0)
306+ item.displayMarginEnd = -Math.max(baseItem.height - seeAll.height
307+ - categoryView.height + baseItem.y, 0)
307 }
308 }
308 }
309 }
309 }
310 }
311+ }
310
312
311− Image {
313+ AbstractButton {
312− visible: index != 0
314+ id: seeAll
313− anchors {
315+ objectName: "seeAll"
314− top: parent.top
316+ anchors {
315− left: parent.left
317+ top: rendererLoader.bottom
316− right: parent.right
318+ left: parent.left
319+ right: parent.right
320+ }
321+ height: baseItem.expandable ? seeAllLabel.font.pixelSize + units.gu(6) : 0
322+
323+ onClicked: {
324+ if (categoryView.expandedCategoryId != baseItem.category) {
325+ categoryView.expandedCategoryId = baseItem.category;
326+ } else {
327+ categoryView.expandedCategoryId = "";
317 }
328 }
318− fillMode: Image.Stretch
319− source: "graphics/dash_divider_top_lightgrad.png"
320− z: -1
321 }
329 }
322
330
323− Image {
331+ Label {
324− // FIXME Should not rely on model.count but view.count, but ListViewWithPageHeader doesn't expose it yet.
332+ id: seeAllLabel
325− visible: index != categoryView.model.count - 1
333+ text: baseItem.expanded ? i18n.tr("See less") : i18n.tr("See all")
326 anchors {
334 anchors {
327− bottom: parent.bottom
335+ centerIn: parent
328− left: parent.left
336+ verticalCenterOffset: units.gu(-0.5)
329− right: parent.right
330 }
337 }
331− fillMode: Image.Stretch
338+ fontSize: "small"
332− source: "graphics/dash_divider_top_darkgrad.png"
339+ font.weight: Font.Bold
333− z: -1
340+ color: scopeStyle ? scopeStyle.foreground : "grey"
341+ visible: baseItem.expandable
334 }
342 }
335 }
343 }
344+
345+ Image {
346+ visible: index != 0
347+ anchors {
348+ top: parent.top
349+ left: parent.left
350+ right: parent.right
351+ }
352+ fillMode: Image.Stretch
353+ source: "graphics/dash_divider_top_lightgrad.png"
354+ z: -1
355+ }
356+
357+ Image {
358+ // FIXME Should not rely on model.count but view.count, but ListViewWithPageHeader doesn't expose it yet.
359+ visible: index != categoryView.model.count - 1
360+ anchors {
361+ bottom: seeAll.bottom
362+ left: parent.left
363+ right: parent.right
364+ }
365+ fillMode: Image.Stretch
366+ source: "graphics/dash_divider_top_darkgrad.png"
367+ z: -1
368+ }
336 }
369 }
337
370
338 sectionProperty: "name"
371 sectionProperty: "name"
@@ -342,17 +375,6 @@ FocusScope {
342 width: categoryView.width
375 width: categoryView.width
343 text: section
376 text: section
344 textColor: scopeStyle ? scopeStyle.foreground : "grey"
377 textColor: scopeStyle ? scopeStyle.foreground : "grey"
345− image: {
346− if (delegate && delegate.expandable)
347− return delegate.expanded ? "graphics/header_handlearrow2.png" : "graphics/header_handlearrow.png"
348− return "";
349− }
350− onClicked: {
351− if (categoryView.expandedCategoryId != delegate.category)
352− categoryView.expandedCategoryId = delegate.category;
353− else
354− categoryView.expandedCategoryId = "";
355− }
356 }
378 }
357
379
358 pageHeader: PageHeader {
380 pageHeader: PageHeader {
tests/autopilot/unity8/shell/emulators/dash.py+1−1
@@ -209,7 +209,7 @@ class DashApps(GenericScopeView):
209
209
210 result = []
210 result = []
211 for card in application_cards:
211 for card in application_cards:
212− if card.objectName != 'cardToolCard':
212+ if card.objectName not in ('cardToolCard', 'seeAll'):
213 result.append(card.title)
213 result.append(card.title)
214 return result
214 return result
215
215
tests/qmltests/Dash/tst_GenericScopeView.qml+18−21
@@ -104,53 +104,50 @@ Item {
104 tryCompare(genericScopeView.scope, "searchQuery", "test")
104 tryCompare(genericScopeView.scope, "searchQuery", "test")
105 }
105 }
106
106
107− function test_filter_expand_collapse() {
107+ function test_expand_collapse() {
108 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader0") != null; }, true);
108 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader0") != null; }, true);
109
109
110− var header = findChild(genericScopeView, "dashSectionHeader0")
111 var category = findChild(genericScopeView, "dashCategory0")
110 var category = findChild(genericScopeView, "dashCategory0")
111+ var seeAll = findChild(category, "seeAll")
112
112
113− waitForRendering(header);
113+ waitForRendering(seeAll);
114 verify(category.expandable);
114 verify(category.expandable);
115 verify(!category.expanded);
115 verify(!category.expanded);
116
116
117 var initialHeight = category.height;
117 var initialHeight = category.height;
118− var middleHeight;
119− mouseClick(header, header.width / 2, header.height / 2);
118+ mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
120− tryCompareFunction(function() { middleHeight = category.height; return category.height > initialHeight; }, true);
119+ verify(category.expanded);
121− tryCompare(category, "expanded", true);
122− tryCompareFunction(function() { return category.height > middleHeight; }, true);
120+ tryCompareFunction(function() { return category.height > initialHeight; }, true);
123
121
124− mouseClick(header, header.width / 2, header.height / 2);
122+ mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
125− verify(category.expandable);
123+ verify(!category.expanded);
126− tryCompare(category, "expanded", false);
127 }
124 }
128
125
129− function test_filter_expand_expand_collapse() {
126+ function test_expand_expand_collapse() {
130 // wait for the item to be there
127 // wait for the item to be there
131 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader2") != null; }, true);
128 tryCompareFunction(function() { return findChild(genericScopeView, "dashSectionHeader2") != null; }, true);
132
129
133 var categoryListView = findChild(genericScopeView, "categoryListView");
130 var categoryListView = findChild(genericScopeView, "categoryListView");
134 categoryListView.contentY = categoryListView.height;
131 categoryListView.contentY = categoryListView.height;
135
132
136− var header2 = findChild(genericScopeView, "dashSectionHeader2")
137 var category2 = findChild(genericScopeView, "dashCategory2")
133 var category2 = findChild(genericScopeView, "dashCategory2")
134+ var seeAll2 = findChild(category2, "seeAll")
138
135
139− waitForRendering(header2);
136+ waitForRendering(seeAll2);
140 verify(category2.expandable);
137 verify(category2.expandable);
141 verify(!category2.expanded);
138 verify(!category2.expanded);
142
139
143− mouseClick(header2, header2.width / 2, header2.height / 2);
140+ mouseClick(seeAll2, seeAll2.width / 2, seeAll2.height / 2);
144 tryCompare(category2, "expanded", true);
141 tryCompare(category2, "expanded", true);
145
142
146 categoryListView.positionAtBeginning();
143 categoryListView.positionAtBeginning();
147
144
148− var header0 = findChild(genericScopeView, "dashSectionHeader0")
149 var category0 = findChild(genericScopeView, "dashCategory0")
145 var category0 = findChild(genericScopeView, "dashCategory0")
146+ var seeAll0 = findChild(category0, "seeAll")
150− mouseClick(header0, header0.width / 2, header0.height / 2);
147+ mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
151 tryCompare(category0, "expanded", true);
148 tryCompare(category0, "expanded", true);
152 tryCompare(category2, "expanded", false);
149 tryCompare(category2, "expanded", false);
153− mouseClick(header0, header0.width / 2, header0.height / 2);
150+ mouseClick(seeAll0, seeAll0.width / 2, seeAll0.height / 2);
154 tryCompare(category0, "expanded", false);
151 tryCompare(category0, "expanded", false);
155 tryCompare(category2, "expanded", false);
152 tryCompare(category2, "expanded", false);
156 }
153 }
@@ -163,11 +160,11 @@ Item {
163 shell.width = units.gu(20)
160 shell.width = units.gu(20)
164 var categoryListView = findChild(genericScopeView, "categoryListView");
161 var categoryListView = findChild(genericScopeView, "categoryListView");
165 categoryListView.contentY = units.gu(20);
162 categoryListView.contentY = units.gu(20);
166− var header0 = findChild(genericScopeView, "dashSectionHeader0")
163+ var seeAll = findChild(category, "seeAll")
167− mouseClick(header0, header0.width / 2, header0.height / 2);
164+ mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
168 tryCompare(category, "expanded", true);
165 tryCompare(category, "expanded", true);
169 tryCompareFunction(function() { return category.item.height == genericScopeView.height - category.item.displayMarginBeginning - category.item.displayMarginEnd; }, true);
166 tryCompareFunction(function() { return category.item.height == genericScopeView.height - category.item.displayMarginBeginning - category.item.displayMarginEnd; }, true);
170− mouseClick(header0, header0.width / 2, header0.height / 2);
167+ mouseClick(seeAll, seeAll.width / 2, seeAll.height / 2);
171 tryCompare(category, "expanded", false);
168 tryCompare(category, "expanded", false);
172 }
169 }
173
170