Merge lp:~rpadovani/webbrowser-app/suggestions-list-visual-update into lp:webbrowser-app

Proposed by Riccardo Padovani
Status: Needs review
Proposed branch: lp:~rpadovani/webbrowser-app/suggestions-list-visual-update
Merge into: lp:webbrowser-app
Diff against target: 129 lines (+31/-11)
3 files modified
src/app/webbrowser/Browser.qml (+3/-3)
src/app/webbrowser/Suggestion.qml (+10/-1)
src/app/webbrowser/Suggestions.qml (+18/-7)
To merge this branch: bzr merge lp:~rpadovani/webbrowser-app/suggestions-list-visual-update
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+257724@code.launchpad.net

Commit message

Update the visual design of suggestions list according to design spec

Description of the change

Update the visual design of suggestions list according to design spec.

In spec there is specified the size of text. IMO is too small now, and was better the previous size

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
989. By Riccardo Padovani

Merge from upstream and fix conflicts

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

989. By Riccardo Padovani

Merge from upstream and fix conflicts

988. By Riccardo Padovani

Update visual design of suggestions list

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/app/webbrowser/Browser.qml'
2--- src/app/webbrowser/Browser.qml 2015-06-02 14:26:38 +0000
3+++ src/app/webbrowser/Browser.qml 2015-06-12 09:31:31 +0000
4@@ -365,10 +365,10 @@
5 enabled: opacity > 0
6 anchors {
7 top: chrome.bottom
8- horizontalCenter: parent.horizontalCenter
9+ left: parent.left
10+ right: parent.right
11 }
12- width: chrome.width - units.gu(5)
13- height: enabled ? Math.min(contentHeight, tabContainer.height - chrome.height - units.gu(2)) : 0
14+ height: enabled ? contentHeight : 0
15
16 searchTerms: chrome.text.split(/\s+/g).filter(function(term) { return term.length > 0 })
17
18
19=== modified file 'src/app/webbrowser/Suggestion.qml'
20--- src/app/webbrowser/Suggestion.qml 2015-04-22 11:00:02 +0000
21+++ src/app/webbrowser/Suggestion.qml 2015-06-12 09:31:31 +0000
22@@ -23,10 +23,12 @@
23 // Not using ListItem.Subtitled because it’s not themable,
24 // and we want the subText to be on one line only.
25 ListItem.Base {
26+ id: root
27 property alias title: label.text
28 property alias subtitle: subLabel.text
29 property alias icon: icon.name
30 property url url
31+ property var textColor: "#5d5d5d"
32
33 signal selected(url url)
34
35@@ -34,6 +36,10 @@
36 // disable focus handling
37 activeFocusOnPress: false
38
39+ onPressedChanged: {
40+ textColor = pressed ? "#db4923" : "#5d5d5d"
41+ }
42+
43 Item {
44 id: middleVisuals
45 anchors {
46@@ -63,6 +69,8 @@
47 right: parent.right
48 }
49
50+ color: root.textColor
51+ fontSize: "x-small"
52 elide: Text.ElideRight
53 }
54
55@@ -74,7 +82,8 @@
56 leftMargin: units.gu(2)
57 right: parent.right
58 }
59- fontSize: "small"
60+ color: root.textColor
61+ fontSize: "xx-small"
62 elide: Text.ElideRight
63 visible: text !== ""
64 }
65
66=== modified file 'src/app/webbrowser/Suggestions.qml'
67--- src/app/webbrowser/Suggestions.qml 2015-05-12 09:56:40 +0000
68+++ src/app/webbrowser/Suggestions.qml 2015-06-12 09:31:31 +0000
69@@ -41,10 +41,15 @@
70 id: suggestionsList
71 anchors.fill: parent
72
73+ boundsBehavior: childrenRect.height > height ?
74+ Flickable.DragAndOvershootBounds :
75+ Flickable.StopAtBounds
76+
77 model: suggestions.models
78+
79 delegate: Column {
80 id: suggestionsSection
81- width: suggestionsList.width
82+ anchors {left: parent.left; right: parent.right}
83 height: childrenRect.height
84
85 property string icon: models[index].icon
86@@ -57,7 +62,12 @@
87
88 delegate: Suggestion {
89 id: suggestion
90- width: suggestionsList.width
91+
92+ anchors {
93+ left: parent ? parent.left : undefined
94+ right: parent ? parent.right : undefined
95+ }
96+
97 showDivider: suggestionsSection.firstItemIndex + index <
98 suggestions.count - 1
99
100@@ -66,8 +76,8 @@
101 // expose their data differently
102 property var item: (model.modelData) ? model.modelData : model
103
104- title: highlightTerms(item.title)
105- subtitle: suggestionsSection.displayUrl ? highlightTerms(item.url) : ""
106+ title: highlightTerms(item.title, pressed)
107+ subtitle: suggestionsSection.displayUrl ? highlightTerms(item.url, pressed) : ""
108 icon: suggestionsSection.icon
109
110 onSelected: suggestions.selected(item.url)
111@@ -89,14 +99,15 @@
112 return new RegExp(escaped, 'ig')
113 }
114
115- function highlightTerms(text) {
116- // Highlight the matching terms (bold and Ubuntu orange)
117+ function highlightTerms(text, pressed) {
118+ // Highlight the matching terms (bold and #db4923 if pressed, otherwise #752571)
119+ var color = pressed ? "#db4923" : "#752571"
120 if (text === undefined) {
121 return ''
122 }
123 var highlighted = text.toString()
124 var count = searchTerms.length
125- var highlight = '<b><font color="%1">$&</font></b>'.arg(UbuntuColors.orange)
126+ var highlight = '<b><font color="%1">$&</font></b>'.arg(color)
127 for (var i = 0; i < count; ++i) {
128 var term = searchTerms[i]
129 highlighted = highlighted.replace(escapeTerm(term), highlight)

Subscribers

People subscribed via source and target branches

to status/vote changes: