Merge lp:~aacid/unity8/optionselector_filter_visual_improvements into lp:unity8

Proposed by Albert Astals Cid on 2015-11-10
Status: Merged
Approved by: Andrea Cimitan on 2015-12-18
Approved revision: 2021
Merged at revision: 2297
Proposed branch: lp:~aacid/unity8/optionselector_filter_visual_improvements
Merge into: lp:unity8
Prerequisite: lp:~aacid/unity8/optionselector_filter
Diff against target: 520 lines (+159/-111)
9 files modified
plugins/Dash/ScopeStyle.qml (+1/-1)
qml/Dash/DashNavigation.qml (+2/-20)
qml/Dash/DashNavigationHeader.qml (+1/-3)
qml/Dash/DashNavigationList.qml (+30/-19)
qml/Dash/DashPageHeader.qml (+75/-53)
qml/Dash/Filters/FilterOptionSelector.qml (+1/-0)
qml/Dash/FiltersPopover.qml (+1/-0)
qml/Dash/GenericScopeView.qml (+1/-1)
qml/Dash/PageHeaderExtraPanel.qml (+47/-14)
To merge this branch: bzr merge lp:~aacid/unity8/optionselector_filter_visual_improvements
Reviewer Review Type Date Requested Status
Andrea Cimitan (community) 2015-11-10 Approve on 2015-12-18
PS Jenkins bot continuous-integration Needs Fixing on 2015-12-16
Review via email: mp+277138@code.launchpad.net

This proposal supersedes a proposal from 2015-11-10.

Commit Message

Match design visuals for the new dash navigation/page header popup

Description of the Change

 * Are there any related MPs required for this MP to build/function as expected?
Prerequisite

 * 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?
This is to match the visuals provided at https://docs.google.com/a/canonical.com/presentation/d/1-cJXJPLml757IxAn8QJbXoyzUJMSby-PrGYFNNTv188/edit?usp=sharing by design

To post a comment you must log in.
2011. By Albert Astals Cid on 2015-11-12

Merge

2012. By Albert Astals Cid on 2015-11-16

Merge

2013. By Albert Astals Cid on 2015-11-18

Merge

2014. By Albert Astals Cid on 2015-11-23

Merge

2015. By Albert Astals Cid on 2015-11-23

Merge

2016. By Albert Astals Cid on 2015-11-30

Merge

Andrea Cimitan (cimi) wrote :

Many hardcoded colors. For some of them, we can reuse the uitk palette (like foreground for example). Can we reuse that?

review: Needs Information
2017. By Albert Astals Cid on 2015-12-01

Merge

Albert Astals Cid (aacid) wrote :

> Many hardcoded colors. For some of them, we can reuse the uitk palette (like
> foreground for example). Can we reuse that?

The problem i see is this:
 * We don't have all the colors they want in the palette
 * The palette depends on the theme

So if we make some of the colors be palette based (the ones that are in there) but some others not, when you change them it will most likely look ultra weird, with some of the colors following the theme and some not. At least with the current code none of them will follow the theme, which is also bad but in my opinion less bad.

I'm open to convincing otherwise, though

2018. By Albert Astals Cid on 2015-12-09

Merge

2019. By Albert Astals Cid on 2015-12-14

Merge

2020. By Albert Astals Cid on 2015-12-15

Merge

2021. By Albert Astals Cid on 2015-12-16

Fix binding loop and label misplacement on the phone

Andrea Cimitan (cimi) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
y
 * Did CI run pass? If not, please explain why.
unrelated
 * Did you make sure that the branch does not contain spurious tags?
y

review: Approve
2022. By Albert Astals Cid on 2016-01-11

Merge

2023. By Albert Astals Cid on 2016-01-13

Merge

2024. By Albert Astals Cid on 2016-01-22

Merge

2025. By Albert Astals Cid on 2016-01-26

Fix clicking on recent searches

2026. By Albert Astals Cid on 2016-01-26

Clicking on the (X) filters should open filters too instead of focus on search field

2027. By Albert Astals Cid on 2016-01-26

Merge

2028. By Albert Astals Cid on 2016-01-27

Merge

2029. By Albert Astals Cid on 2016-01-27

Focus the expandable on expanding

Removes focus from other filters like the range selector

2030. By Albert Astals Cid on 2016-02-04

Merge

2031. By Albert Astals Cid on 2016-02-04

Move the settings button out of the search line edit

2032. By Albert Astals Cid on 2016-02-11

Design wants to experiment/test with a bigger top margin

2033. By Albert Astals Cid on 2016-02-11

we show filter button all the time now if there's filters

2034. By Albert Astals Cid on 2016-02-19

Merge

2035. By Albert Astals Cid on 2016-02-22

Merge

2036. By Albert Astals Cid on 2016-03-03

Make the cancelButton be bigger than jsut exactly the cancel text

2037. By Albert Astals Cid on 2016-03-03

less warnings on rebuilding of the repeater

2038. By Albert Astals Cid on 2016-03-03

Fix height calculations

2039. By Albert Astals Cid on 2016-03-03

Hide the extraPanel when showing the popup

2040. By Albert Astals Cid on 2016-03-03

Merge

2041. By Albert Astals Cid on 2016-03-07

Merge

2042. By Albert Astals Cid on 2016-03-08

Merge

2043. By Albert Astals Cid on 2016-03-08

We need to clip here

Otherwise you can touch the items that "outside" the popover when there are too many that the flickable height != contentHeight

2044. By Albert Astals Cid on 2016-03-14

Merge

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Dash/ScopeStyle.qml'
2--- plugins/Dash/ScopeStyle.qml 2015-07-15 15:07:19 +0000
3+++ plugins/Dash/ScopeStyle.qml 2016-03-14 08:53:47 +0000
4@@ -58,7 +58,7 @@
5 readonly property url headerLogo: "logo" in d.headerStyle ? d.headerStyle["logo"] : ""
6
7 /// Background style for the header
8- readonly property url headerBackground: "background" in d.headerStyle ? d.headerStyle["background"] : "color:///#f5f5f5"
9+ readonly property url headerBackground: "background" in d.headerStyle ? d.headerStyle["background"] : "color:///#ffffff"
10
11 /// Foreground color for the header
12 readonly property color headerForeground: "foreground-color" in d.headerStyle ? d.headerStyle["foreground-color"] : foreground
13
14=== modified file 'qml/Dash/DashNavigation.qml'
15--- qml/Dash/DashNavigation.qml 2016-03-14 08:53:46 +0000
16+++ qml/Dash/DashNavigation.qml 2016-03-14 08:53:47 +0000
17@@ -24,7 +24,6 @@
18
19 // set by parent
20 property var scope: null
21- property var scopeStyle: null
22 property real availableHeight
23
24 signal leafClicked()
25@@ -43,13 +42,6 @@
26 }
27 }
28
29- QtObject {
30- id: d
31- readonly property color foregroundColor: root.scopeStyle
32- ? root.scopeStyle.getTextColor(backgroundItem.luminance)
33- : theme.palette.normal.baseText
34- }
35-
36 Column {
37 id: headersColumn
38 anchors {
39@@ -82,11 +74,10 @@
40 delegate: DashNavigationHeader {
41 objectName: "dashNavigationHeader" + index
42 height: index == 0 && headersModel.count > 1 ? 0 : units.gu(5)
43- width: parent.width
44+ width: headersColumn.width
45
46 backVisible: index != 0
47 text: headerText
48- foregroundColor: d.foregroundColor
49
50 onBackClicked: {
51 scope.setNavigationState(parentNavigationId);
52@@ -124,12 +115,7 @@
53 left: parent.left
54 right: parent.right
55 }
56- property int maxHeight: -1
57- Component.onCompleted: updateMaxHeight();
58- function updateMaxHeight()
59- {
60- maxHeight = root.availableHeight - mapToItem(root, 0, 0).y;
61- }
62+ readonly property int maxHeight: root.availableHeight - navigationListView.y
63 property int prevHeight: maxHeight
64 height: currentItem ? currentItem.height : maxHeight
65
66@@ -143,13 +129,9 @@
67 objectName: "navigation" + index
68 visible: height > 0
69 width: navigationListView.width
70- itemsIndent: index != 0 ? units.gu(5) : 0
71- scopeStyle: root.scopeStyle
72- foregroundColor: d.foregroundColor
73 property real desiredHeight: {
74 if (navigation && navigation.loaded && x == navigationListView.contentX)
75 {
76- navigationListView.updateMaxHeight();
77 return Math.min(implicitHeight, navigationListView.maxHeight);
78 } else {
79 return navigationListView.prevHeight;
80
81=== modified file 'qml/Dash/DashNavigationHeader.qml'
82--- qml/Dash/DashNavigationHeader.qml 2016-03-14 08:53:46 +0000
83+++ qml/Dash/DashNavigationHeader.qml 2016-03-14 08:53:47 +0000
84@@ -22,7 +22,6 @@
85 id: root
86
87 property alias backVisible: backImageItem.visible
88- property alias foregroundColor: backImage.color
89 property alias textEnabled: textItem.enabled
90 property alias text: textLabel.text
91
92@@ -63,8 +62,7 @@
93 leftMargin: backImageItem.visible ? 0 : units.gu(2)
94 rightMargin: units.gu(2)
95 }
96- font.bold: true
97- color: root.foregroundColor
98+ color: "#5D5D5D"
99 wrapMode: Text.Wrap
100 maximumLineCount: 2
101 elide: Text.ElideMiddle
102
103=== modified file 'qml/Dash/DashNavigationList.qml'
104--- qml/Dash/DashNavigationList.qml 2016-03-14 08:53:46 +0000
105+++ qml/Dash/DashNavigationList.qml 2016-03-14 08:53:47 +0000
106@@ -16,16 +16,12 @@
107
108 import QtQuick 2.4
109 import Ubuntu.Components 1.3
110-import Ubuntu.Components.ListItems 1.3 as ListItem
111 import "../Components"
112
113 Item {
114 id: root
115- property real itemsIndent: 0
116 property var navigation: null
117 property var currentNavigation: null
118- property var scopeStyle: null
119- property color foregroundColor: theme.palette.normal.baseText
120 signal enterNavigation(var newNavigationId, string newNavigationLabel, bool hasChildren)
121
122 readonly property int itemHeight: units.gu(5)
123@@ -56,27 +52,42 @@
124 Repeater {
125 model: navigation && navigation.loaded ? navigation : null
126 clip: true
127- delegate: ListItem.Standard {
128+ delegate: ListItem {
129 objectName: root.objectName + "child" + index
130 height: root.itemHeight
131- showDivider: index != navigation.count - 1
132- selected: isActive
133- anchors.left: parent.left
134- anchors.leftMargin: itemsIndent
135- anchors.right: parent.right
136+ width: column.width
137+ anchors {
138+ left: column.left
139+ right: column.right
140+ leftMargin: units.gu(2)
141+ rightMargin: units.gu(2)
142+ }
143
144 onClicked: root.enterNavigation(navigationId, allLabel != "" ? allLabel : label, hasChildren)
145
146+ Icon {
147+ id: leftIcon
148+ anchors {
149+ verticalCenter: parent.verticalCenter
150+ left: parent.left
151+ }
152+ height: units.gu(2)
153+ width: height
154+ name: "tick"
155+ color: "#3EB34F"
156+ visible: isActive
157+ }
158+
159 Label {
160 anchors {
161 verticalCenter: parent.verticalCenter
162- left: parent.left
163- leftMargin: itemsIndent > 0 ? 0 : units.gu(2)
164- right: rightIcon.visible ? rightIcon.left : parent.right
165- rightMargin: rightIcon.visible ? units.gu(0.5) : units.gu(2)
166+ left: leftIcon.right
167+ leftMargin: units.gu(1)
168+ right: rightIcon.left
169+ rightMargin: units.gu(2)
170 }
171 text: label
172- color: root.foregroundColor
173+ color: isActive ? "#333333" : "#888888"
174 wrapMode: Text.Wrap
175 maximumLineCount: 2
176 elide: Text.ElideMiddle
177@@ -87,14 +98,14 @@
178 anchors {
179 verticalCenter: parent.verticalCenter
180 right: parent.right
181- rightMargin: units.gu(2)
182 }
183 height: units.gu(2)
184 width: height
185- name: hasChildren ? "go-next" : "tick"
186- color: root.foregroundColor
187- visible: hasChildren || isActive
188+ name: "go-next"
189+ visible: hasChildren
190 }
191+
192+ divider.visible: index != navigation.count - 1
193 }
194 }
195 }
196
197=== modified file 'qml/Dash/DashPageHeader.qml'
198--- qml/Dash/DashPageHeader.qml 2016-03-14 08:53:46 +0000
199+++ qml/Dash/DashPageHeader.qml 2016-03-14 08:53:47 +0000
200@@ -202,51 +202,43 @@
201 left: parent.left
202 bottom: parent.bottom
203 bottomMargin: units.gu(1)
204- right: cancelLabel.left
205- rightMargin: units.gu(1)
206- }
207-
208- readonly property bool clearIsSettings: !searchTextField.focus && root.scopeHasFilters
209-
210- primaryItem: Label {
211- text: root.navigationTag
212- }
213-
214- secondaryItem: Row {
215+ right: settingsButton.left
216+ rightMargin: settingsButton.visible ? 0 : units.gu(2)
217+ }
218+
219+ primaryItem: Rectangle {
220+ color: "#F5F4F5"
221+ width: root.navigationTag != "" ? tagLabel.width + units.gu(2) : 0
222+ height: root.navigationTag != "" ? tagLabel.height + units.gu(1) : 0
223+ radius: units.gu(0.5)
224+ Label {
225+ id: tagLabel
226+ text: root.navigationTag
227+ anchors.centerIn: parent
228+ color: "#333333"
229+ }
230+ }
231+
232+ secondaryItem: AbstractButton {
233+ id: clearButton
234 height: searchTextField.height
235-
236- AbstractButton {
237- id: clearOrSettingsButton
238- height: parent.height
239- width: height
240- enabled: searchTextField.text.length > 0 || root.navigationTag != ""
241-
242- Image {
243- objectName: "clearIcon"
244- anchors.fill: parent
245- anchors.margins: units.gu(.75)
246- source: searchTextField.clearIsSettings ? "image://theme/settings" : "image://theme/clear"
247- opacity: parent.enabled
248- visible: opacity > 0
249- Behavior on opacity {
250- UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration }
251- }
252- }
253-
254- onClicked: {
255- if (searchTextField.clearIsSettings) {
256- root.showFiltersPopup(clearOrSettingsButton);
257- } else {
258- root.clearSearch(true);
259- }
260+ width: height
261+ enabled: searchTextField.text.length > 0 || root.navigationTag != ""
262+
263+ Image {
264+ objectName: "clearIcon"
265+ anchors.fill: parent
266+ anchors.margins: units.gu(1)
267+ source: "image://theme/clear"
268+ opacity: parent.enabled
269+ visible: opacity > 0
270+ Behavior on opacity {
271+ UbuntuNumberAnimation { duration: UbuntuAnimation.FastDuration }
272 }
273 }
274
275- Label {
276- visible: searchTextField.clearIsSettings && root.activeFiltersCount > 0
277- height: parent.height
278- text: root.activeFiltersCount
279- verticalAlignment: Text.AlignVCenter
280+ onClicked: {
281+ root.clearSearch(true);
282 }
283 }
284
285@@ -264,22 +256,52 @@
286 }
287 }
288
289- Label {
290- id: cancelLabel
291- text: i18n.tr("Cancel")
292- color: header.panelForegroundColor
293- verticalAlignment: Text.AlignVCenter
294+ AbstractButton {
295+ id: settingsButton
296+
297+ width: root.scopeHasFilters ? height : 0
298+ visible: width > 0
299+ anchors {
300+ top: parent.top
301+ right: cancelButton.left
302+ bottom: parent.bottom
303+ rightMargin: units.gu(-1)
304+ }
305+
306+ Icon {
307+ anchors.fill: parent
308+ anchors.margins: units.gu(2)
309+ name: "filters"
310+ color: root.activeFiltersCount > 0 ? UbuntuColors.orange : Qt.rgba(0.0, 0.0, 0.0, 0.0)
311+ }
312+
313+ onClicked: {
314+ root.showFiltersPopup(settingsButton);
315+ }
316+ }
317+
318+ AbstractButton {
319+ id: cancelButton
320+ width: cancelLabel.width + cancelLabel.anchors.rightMargin + cancelLabel.anchors.leftMargin
321 anchors {
322 top: parent.top
323 right: parent.right
324 bottom: parent.bottom
325- margins: units.gu(1)
326- }
327- AbstractButton {
328- anchors.fill: parent
329- onClicked: {
330- root.clearSearch(false);
331- headerContainer.showSearch = false;
332+ }
333+ onClicked: {
334+ root.clearSearch(false);
335+ headerContainer.showSearch = false;
336+ }
337+ Label {
338+ id: cancelLabel
339+ text: i18n.tr("Cancel")
340+ color: header.panelForegroundColor
341+ verticalAlignment: Text.AlignVCenter
342+ anchors {
343+ verticalCenter: parent.verticalCenter
344+ right: parent.right
345+ rightMargin: units.gu(2)
346+ leftMargin: units.gu(1)
347 }
348 }
349 }
350
351=== modified file 'qml/Dash/Filters/FilterOptionSelector.qml'
352--- qml/Dash/Filters/FilterOptionSelector.qml 2016-03-14 08:53:46 +0000
353+++ qml/Dash/Filters/FilterOptionSelector.qml 2016-03-14 08:53:47 +0000
354@@ -34,6 +34,7 @@
355
356 onClicked: {
357 expanded = !expanded;
358+ forceActiveFocus();
359 }
360
361 Item {
362
363=== modified file 'qml/Dash/FiltersPopover.qml'
364--- qml/Dash/FiltersPopover.qml 2016-03-14 08:53:46 +0000
365+++ qml/Dash/FiltersPopover.qml 2016-03-14 08:53:47 +0000
366@@ -37,6 +37,7 @@
367 var parentAndKeyboard = root.parent.height - posToRootParent - (Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height + units.gu(3) : 0)
368 return Math.min(parentAndKeyboard, Math.min(threeQuartersParent, column.height));
369 }
370+ clip: true
371 contentHeight: column.height
372 contentWidth: width
373
374
375=== modified file 'qml/Dash/GenericScopeView.qml'
376--- qml/Dash/GenericScopeView.qml 2016-03-14 08:53:46 +0000
377+++ qml/Dash/GenericScopeView.qml 2016-03-14 08:53:47 +0000
378@@ -651,6 +651,7 @@
379 }
380 }
381 onShowFiltersPopup: { // item
382+ extraPanel.visible = false;
383 scopeView.filtersPopover = PopupUtils.open(Qt.resolvedUrl("FiltersPopover.qml"), item, { "contentWidth": scopeView.width - units.gu(2) } );
384 }
385 }
386@@ -668,7 +669,6 @@
387
388 searchHistory: SearchHistoryModel
389 scope: scopeView.scope
390- scopeStyle: scopeView.scopeStyle
391 windowHeight: scopeView.height
392
393 onHistoryItemClicked: {
394
395=== modified file 'qml/Dash/PageHeaderExtraPanel.qml'
396--- qml/Dash/PageHeaderExtraPanel.qml 2016-03-14 08:53:46 +0000
397+++ qml/Dash/PageHeaderExtraPanel.qml 2016-03-14 08:53:47 +0000
398@@ -16,20 +16,19 @@
399
400 import QtQuick 2.4
401 import Ubuntu.Components 1.3
402-import Ubuntu.Components.ListItems 1.3
403+import Ubuntu.Components.ListItems 1.3 as ListItems
404 import "Filters" as Filters
405
406 Item {
407 id: root
408
409- readonly property real searchesHeight: recentSearchesRepeater.count > 0 ? searchColumn.height + recentSearchesLabels.height + recentSearchesLabels.anchors.margins : 0
410+ readonly property real searchesHeight: recentSearchesRepeater.count > 0 ? searchColumn.height + recentSearchesLabels.height + recentSearchesLabels.anchors.topMargin : 0
411
412- implicitHeight: searchesHeight + dashNavigation.implicitHeight + primaryFilter.height
413+ implicitHeight: searchesHeight + dashNavigation.implicitHeight + dashNavigation.anchors.topMargin + primaryFilter.height + primaryFilter.anchors.topMargin
414
415 // Set by parent
416 property ListModel searchHistory
417 property var scope: null
418- property var scopeStyle: null
419 property real windowHeight
420
421 // Used by PageHeader
422@@ -47,6 +46,10 @@
423 anchors.fill: parent
424 }
425
426+ ListItems.ThinDivider {
427+ anchors.top: parent.top
428+ }
429+
430 Label {
431 id: recentSearchesLabels
432 text: i18n.tr("Recent Searches")
433@@ -54,7 +57,8 @@
434 anchors {
435 top: parent.top
436 left: parent.left
437- margins: units.gu(1)
438+ margins: units.gu(2)
439+ topMargin: units.gu(3)
440 }
441 }
442
443@@ -65,7 +69,8 @@
444 anchors {
445 top: parent.top
446 right: parent.right
447- margins: units.gu(1)
448+ margins: units.gu(2)
449+ topMargin: units.gu(3)
450 }
451
452 AbstractButton {
453@@ -87,13 +92,40 @@
454 objectName: "recentSearchesRepeater"
455 model: searchHistory
456
457- delegate: Standard {
458- showDivider: index < recentSearchesRepeater.count - 1
459- height: units.gu(4)
460- text: query
461- iconName: "search"
462- iconFrame: false
463- onClicked: root.historyItemClicked(text)
464+ delegate: ListItem {
465+ anchors {
466+ left: parent.left
467+ right: parent.right
468+ leftMargin: units.gu(2)
469+ rightMargin: units.gu(2)
470+ }
471+ height: units.gu(5)
472+
473+ Icon {
474+ id: searchIcon
475+ anchors {
476+ verticalCenter: parent.verticalCenter
477+ left: parent.left
478+ }
479+ height: units.gu(1.5)
480+ width: height
481+ name: "search"
482+ }
483+
484+ Label {
485+ anchors {
486+ verticalCenter: parent.verticalCenter
487+ left: searchIcon.right
488+ leftMargin: units.gu(1)
489+ right: parent.right
490+ }
491+ text: query
492+ color: "#888888"
493+ }
494+
495+ divider.visible: index != repeater.count - 1 || (scope && scope.hasNavigation) || primaryFilter.active
496+
497+ onClicked: root.historyItemClicked(query)
498 }
499 }
500 }
501@@ -103,10 +135,10 @@
502 scope: root.scope
503 anchors {
504 top: recentSearchesRepeater.count > 0 ? searchColumn.bottom : parent.top
505+ topMargin: implicitHeight && recentSearchesRepeater.count > 0 ? units.gu(2) : 0
506 left: parent.left
507 right: parent.right
508 }
509- scopeStyle: root.scopeStyle
510 availableHeight: windowHeight * 4 / 6 - searchesHeight
511
512 onLeafClicked: root.dashNavigationLeafClicked();
513@@ -120,6 +152,7 @@
514
515 anchors {
516 top: recentSearchesRepeater.count > 0 ? searchColumn.bottom : parent.top
517+ topMargin: active && recentSearchesRepeater.count > 0 ? units.gu(2) : 0
518 left: parent.left
519 right: parent.right
520 }

Subscribers

People subscribed via source and target branches