Merge lp:~paolorotolo/ubuntu-clock-app/search-button into lp:ubuntu-clock-app/saucy

Proposed by Paolo Rotolo
Status: Merged
Approved by: Nekhelesh Ramananthan
Approved revision: 189
Merged at revision: 186
Proposed branch: lp:~paolorotolo/ubuntu-clock-app/search-button
Merge into: lp:ubuntu-clock-app/saucy
Diff against target: 336 lines (+281/-12)
3 files modified
clock/WorldClock.qml (+23/-12)
images/search_icon@8.svg (+153/-0)
images/search_item@8.svg (+105/-0)
To merge this branch: bzr merge lp:~paolorotolo/ubuntu-clock-app/search-button
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Nekhelesh Ramananthan Approve
Paolo Rotolo (community) Approve
Review via email: mp+184170@code.launchpad.net

Commit message

Revamped search button to match design specification.

Description of the change

Revamped search button to match design specification. Fixes Bug 1221252.

To post a comment you must log in.
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

The overall implementation looks good now. Just need some very minor fixes.

1. Try reducing the width of the button
2. Remove the anchors.leftMargin: units.gu(1) to bring it closer to the search field as shown in the design.

Atm we are ignoring the flat edge as shown in the design since I am not sure how to implement that. One way would be replacing the Button with an Image, but then you would not get the indent effect that you get when you press a button.

review: Needs Fixing
185. By Paolo Rotolo

Made search button smaller.

186. By Paolo Rotolo

Removed anchors.leftMargin.

Revision history for this message
Paolo Rotolo (paolorotolo) wrote :

I'm working on the flat edge. I don't like the current result...

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Sure if that can be done, it would be always be great. Btw do not specify width: 40. It should be expressed in terms of units.gu(). Just for future reference.

187. By Paolo Rotolo

Replaced the search Button with an Item.

188. By Paolo Rotolo

Replace search_icon.png with search_icon.svg.

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

As mentioned during our conversation on IRC, I wanted to add some more modifications to your MP instead of creating a new MP myself. You can see the code changes that need to be done at http://paste.ubuntu.com/6071885/.

The result of that is http://imgur.com/ZarSv6n

The code changes do the following,
- Reduces the size of the magnifier icon (pointed out by the designer during my chat with him)
- Changes the anchoring of the searchLabel and searchButton such that they span the entire width of the app. I also tested it on the desktop and it looks good.

That's pretty much. Merge this in to your branch and we are good to merge your MP into trunk.

189. By Paolo Rotolo

Merged nik's changes.

Revision history for this message
Paolo Rotolo (paolorotolo) wrote :

Thanks, I've merged all your changes.

review: Approve
Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

lgtm!

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'clock/WorldClock.qml'
--- clock/WorldClock.qml 2013-09-05 17:13:40 +0000
+++ clock/WorldClock.qml 2013-09-06 20:22:56 +0000
@@ -73,14 +73,14 @@
73 TextField {73 TextField {
74 id: searchLabel74 id: searchLabel
7575
76 anchors { left: parent.left; leftMargin: (worldClocks.width - width - units.gu(1) - searchButton.width)/2; top: parent.top; bottom: parent.bottom }76 anchors { left: parent.left; leftMargin: units.gu(2); top: parent.top; bottom: parent.bottom; right: searchButton.left; rightMargin: -units.gu(1) }
77 width: worldClocks.width/1.577 width: worldClocks.width/1.5
78 hasClearButton: true78 hasClearButton: true
79 placeholderText: i18n.tr("Search")79 placeholderText: i18n.tr("Search")
80 primaryItem: Image {80 primaryItem: Image {
81 height: parent.height/1.481 height: parent.height/2
82 width: parent.height/1.4582 width: parent.height/2
83 source: Qt.resolvedUrl("../images/search_icon.png")83 source: Qt.resolvedUrl("../images/search_icon.svg")
84 }84 }
8585
86 // Provide a small pause before going online to search86 // Provide a small pause before going online to search
@@ -102,24 +102,35 @@
102 onTextChanged: search_timer.restart()102 onTextChanged: search_timer.restart()
103 }103 }
104104
105 Button {105 Item {
106 id: searchButton;106 id: searchButton;
107107
108 anchors { left: searchLabel.right; leftMargin: units.gu(1); top: parent.top; bottom: parent.bottom }108 anchors { right: parent.right; rightMargin: units.gu(6.5); top: parent.top; bottom: parent.bottom }
109 height: searchLabel.height
109 visible: !searchActivity.running110 visible: !searchActivity.running
110 text: i18n.tr("Search")111 Image {
112 id: name
113 source: Qt.resolvedUrl("../images/search_item.svg")
114 }
111115
112 onClicked: {116 // Make searchButton clickable
113 if (searchLabel.text != "") {117 MouseArea {
114 search_string = searchLabel.text;118 id: searchArea;
115 searchCityModel.source = searchCityUrl(search_string);119 enabled: true;
120 anchors.fill: searchButton
121 onClicked: {
122 if (searchLabel.text != "") {
123 search_string = searchLabel.text;
124 searchCityModel.source = searchCityUrl(search_string);
125 }
116 }126 }
117 }127 }
118 }128 }
119129
130
120 ActivityIndicator {131 ActivityIndicator {
121 id: searchActivity132 id: searchActivity
122 anchors.centerIn: searchButton133 anchors { verticalCenter: searchButton.verticalCenter; left: searchButton.left; leftMargin: units.gu(1.5) }
123 running: searchCityModel.status === XmlListModel.Loading134 running: searchCityModel.status === XmlListModel.Loading
124135
125 }136 }
126137
=== removed file 'images/search_icon@8.png'
127Binary files images/search_icon@8.png 2013-07-18 15:26:43 +0000 and images/search_icon@8.png 1970-01-01 00:00:00 +0000 differ138Binary files images/search_icon@8.png 2013-07-18 15:26:43 +0000 and images/search_icon@8.png 1970-01-01 00:00:00 +0000 differ
=== added file 'images/search_icon@8.svg'
--- images/search_icon@8.svg 1970-01-01 00:00:00 +0000
+++ images/search_icon@8.svg 2013-09-06 20:22:56 +0000
@@ -0,0 +1,153 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- Created with Inkscape (http://www.inkscape.org/) -->
3
4<svg
5 xmlns:dc="http://purl.org/dc/elements/1.1/"
6 xmlns:cc="http://creativecommons.org/ns#"
7 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 xmlns:svg="http://www.w3.org/2000/svg"
9 xmlns="http://www.w3.org/2000/svg"
10 xmlns:xlink="http://www.w3.org/1999/xlink"
11 xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
12 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
13 width="32"
14 height="32"
15 id="svg3133"
16 version="1.1"
17 inkscape:version="0.48.4 r9939"
18 sodipodi:docname="search.svg">
19 <defs
20 id="defs3135">
21 <linearGradient
22 inkscape:collect="always"
23 id="linearGradient3803">
24 <stop
25 style="stop-color:#e7e5e5;stop-opacity:1;"
26 offset="0"
27 id="stop3805" />
28 <stop
29 style="stop-color:#e2dfdf;stop-opacity:1"
30 offset="1"
31 id="stop3807" />
32 </linearGradient>
33 <linearGradient
34 inkscape:collect="always"
35 xlink:href="#linearGradient3803"
36 id="linearGradient3809"
37 x1="53.012165"
38 y1="-102.79017"
39 x2="53.012165"
40 y2="-66.661224"
41 gradientUnits="userSpaceOnUse" />
42 <linearGradient
43 inkscape:collect="always"
44 xlink:href="#linearGradient3803"
45 id="linearGradient3813"
46 gradientUnits="userSpaceOnUse"
47 x1="53.012165"
48 y1="-102.79017"
49 x2="53.012165"
50 y2="-66.661224"
51 gradientTransform="translate(-625,0)" />
52 </defs>
53 <sodipodi:namedview
54 id="base"
55 pagecolor="#ffffff"
56 bordercolor="#666666"
57 borderopacity="1.0"
58 inkscape:pageopacity="0.0"
59 inkscape:pageshadow="2"
60 inkscape:zoom="11.313708"
61 inkscape:cx="27.957393"
62 inkscape:cy="7.2819708"
63 inkscape:document-units="px"
64 inkscape:current-layer="g3842"
65 showgrid="true"
66 inkscape:window-width="1855"
67 inkscape:window-height="1056"
68 inkscape:window-x="65"
69 inkscape:window-y="24"
70 inkscape:window-maximized="1"
71 inkscape:snap-grids="true"
72 inkscape:snap-global="true"
73 fit-margin-top="0"
74 fit-margin-left="0"
75 fit-margin-right="0"
76 fit-margin-bottom="0"
77 inkscape:snap-bbox="true"
78 inkscape:bbox-paths="true"
79 inkscape:bbox-nodes="true"
80 inkscape:snap-bbox-edge-midpoints="true"
81 inkscape:snap-bbox-midpoints="true"
82 inkscape:object-paths="true"
83 inkscape:snap-intersection-paths="true"
84 inkscape:snap-midpoints="true"
85 inkscape:snap-smooth-nodes="true"
86 inkscape:object-nodes="true"
87 inkscape:snap-object-midpoints="true"
88 inkscape:snap-center="true">
89 <inkscape:grid
90 type="xygrid"
91 id="grid3016"
92 empspacing="6"
93 visible="true"
94 enabled="true"
95 snapvisiblegridlinesonly="true"
96 originx="-2.98e-06px"
97 originy="2.6171874e-06px" />
98 </sodipodi:namedview>
99 <metadata
100 id="metadata3138">
101 <rdf:RDF>
102 <cc:Work
103 rdf:about="">
104 <dc:format>image/svg+xml</dc:format>
105 <dc:type
106 rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
107 <dc:title></dc:title>
108 </cc:Work>
109 </rdf:RDF>
110 </metadata>
111 <g
112 inkscape:label="Layer 1"
113 inkscape:groupmode="layer"
114 id="layer1"
115 transform="translate(-2.98e-6,-1020.3622)"
116 style="display:inline">
117 <g
118 transform="matrix(0.99934414,0,0,1,-106.92982,549.00002)"
119 id="g3842"
120 style="display:inline">
121 <rect
122 style="opacity:0.05;color:#000000;fill:none;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
123 id="rect3844"
124 width="32.021008"
125 height="32.000011"
126 x="107"
127 y="-503.36218"
128 transform="scale(1,-1)" />
129 <path
130 sodipodi:type="arc"
131 style="color:#000000;fill:none;stroke:#808080;stroke-width:10.49972248;stroke-miterlimit:4;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
132 id="path2995"
133 sodipodi:cx="35.999996"
134 sodipodi:cy="36.500011"
135 sodipodi:rx="33"
136 sodipodi:ry="33.5"
137 d="m 68.999996,36.500011 a 33,33.5 0 1 1 -65.9999998,0 33,33.5 0 1 1 65.9999998,0 z"
138 transform="matrix(0.30695569,0,0,0.30279797,111.9601,476.31005)" />
139 <path
140 style="font-size:xx-small;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#808080;fill-opacity:1;stroke:none;stroke-width:6;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans"
141 d="m 131.23812,494.07329 -1.51211,1.51111 4.26947,4.26666 1.5121,-1.5111 z"
142 id="path3765"
143 inkscape:connector-curvature="0"
144 sodipodi:nodetypes="ccccc" />
145 <path
146 style="font-size:xx-small;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#808080;fill-opacity:1;stroke:none;stroke-width:11.80387211;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans"
147 d="m 133.30117,495.55563 c -0.82645,0.004 -1.62501,0.54578 -1.9348,1.31198 -0.30979,0.7662 -0.11199,1.71055 0.47924,2.28802 l 3.12758,3.12885 c 1.43195,1.51965 1.74071,1.31459 3.0114,0.0447 1.27069,-1.26986 1.47821,-1.48946 -0.0447,-3.01141 l -3.12758,-3.12885 c -0.39175,-0.40166 -0.95004,-0.63566 -1.51111,-0.63333 z"
148 id="path3767"
149 inkscape:connector-curvature="0"
150 sodipodi:nodetypes="cscczccc" />
151 </g>
152 </g>
153</svg>
0154
=== added file 'images/search_item@8.svg'
--- images/search_item@8.svg 1970-01-01 00:00:00 +0000
+++ images/search_item@8.svg 2013-09-06 20:22:56 +0000
@@ -0,0 +1,105 @@
1<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2<!-- Created with Inkscape (http://www.inkscape.org/) -->
3
4<svg
5 xmlns:dc="http://purl.org/dc/elements/1.1/"
6 xmlns:cc="http://creativecommons.org/ns#"
7 xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
8 xmlns:svg="http://www.w3.org/2000/svg"
9 xmlns="http://www.w3.org/2000/svg"
10 xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
11 xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
12 id="svg2"
13 version="1.1"
14 inkscape:version="0.48.4 r9939"
15 width="40"
16 height="32"
17 sodipodi:docname="search_item@8.svg">
18 <metadata
19 id="metadata8">
20 <rdf:RDF>
21 <cc:Work
22 rdf:about="">
23 <dc:format>image/svg+xml</dc:format>
24 <dc:type
25 rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
26 <dc:title />
27 </cc:Work>
28 </rdf:RDF>
29 </metadata>
30 <defs
31 id="defs6">
32 <linearGradient
33 id="linearGradient4265">
34 <stop
35 style="stop-color:#333333;stop-opacity:1;"
36 offset="0"
37 id="stop4267" />
38 <stop
39 id="stop4273"
40 offset="0.5"
41 style="stop-color:#333333;stop-opacity:0.24855492;" />
42 <stop
43 style="stop-color:#333333;stop-opacity:0;"
44 offset="1"
45 id="stop4269" />
46 </linearGradient>
47 </defs>
48 <sodipodi:namedview
49 pagecolor="#ffffff"
50 bordercolor="#666666"
51 borderopacity="1"
52 objecttolerance="10"
53 gridtolerance="10"
54 guidetolerance="10"
55 inkscape:pageopacity="0"
56 inkscape:pageshadow="2"
57 inkscape:window-width="1855"
58 inkscape:window-height="1056"
59 id="namedview4"
60 showgrid="false"
61 showguides="true"
62 inkscape:guide-bbox="true"
63 inkscape:zoom="45.254834"
64 inkscape:cx="12.76993"
65 inkscape:cy="14.390292"
66 inkscape:window-x="65"
67 inkscape:window-y="24"
68 inkscape:window-maximized="1"
69 inkscape:current-layer="svg2"
70 inkscape:snap-bbox="false">
71 <sodipodi:guide
72 orientation="0,1"
73 position="53.5,37.5"
74 id="guide3007" />
75 </sodipodi:namedview>
76 <rect
77 style="fill:#d05164;fill-opacity:1;stroke:none"
78 id="rect2982-5"
79 width="8.0715103"
80 height="31.993458"
81 x="1.6336422"
82 y="0.0012737503"
83 ry="0" />
84 <rect
85 style="fill:#d05164;fill-opacity:1;stroke:none"
86 id="rect2982"
87 width="36.046421"
88 height="31.998526"
89 x="1.6873904"
90 y="0.0084995022"
91 ry="8.0643663" />
92 <path
93 id="path2987-23-0-9-7-5"
94 style="fill:#ffffff;fill-opacity:1;stroke-width:1.5406878;stroke-miterlimit:4;stroke-dasharray:1.5406878, 6.1627512;stroke-dashoffset:0.7703439"
95 d="m 20.969828,18.441773 c 0,0.888623 -0.720412,1.608978 -1.609035,1.608978 -0.888622,0 -1.608979,-0.720355 -1.608979,-1.608978 0,-0.888624 0.720357,-1.609036 1.608979,-1.609036 0.888623,0 1.609035,0.720412 1.609035,1.609036 z m 2.380792,-3.519786 c 0,0.888623 -0.720356,1.609033 -1.608978,1.609033 -0.888624,0 -1.609036,-0.72041 -1.609036,-1.609033 0,-0.888623 0.720412,-1.60898 1.609036,-1.60898 0.888622,0 1.608978,0.720357 1.608978,1.60898 z m -4.715156,-9.78e-4 c 0,0.888623 -0.720355,1.608978 -1.608978,1.608978 -0.888624,0 -1.608979,-0.720355 -1.608979,-1.608978 0,-0.888623 0.720355,-1.609035 1.608979,-1.609035 0.888623,0 1.608978,0.720412 1.608978,1.609035 z m 7.24089,-3.684795 c 0,0.979475 -0.794056,1.773531 -1.773588,1.773531 -0.979531,0 -1.773586,-0.794056 -1.773586,-1.773531 0,-0.979531 0.794055,-1.7735855 1.773586,-1.7735855 0.979532,0 1.773588,0.7940545 1.773588,1.7735855 z m -4.708009,0.01713 c 0,0.979531 -0.794056,1.773586 -1.773532,1.773586 -0.979531,0 -1.773586,-0.794055 -1.773586,-1.773586 0,-0.979531 0.794055,-1.7735296 1.773586,-1.7735296 0.979476,0 1.773532,0.7939986 1.773532,1.7735296 z m -4.760671,-0.01713 c 0,0.979531 -0.794056,1.773586 -1.773587,1.773586 -0.979531,-1.5e-5 -1.773586,-0.794069 -1.773586,-1.7736 0,-0.979476 0.794055,-1.7735311 1.773586,-1.7735311 0.979531,0 1.773587,0.7940551 1.773587,1.7735311 z"
96 inkscape:connector-curvature="0" />
97 <rect
98 style="fill:#323232;fill-opacity:1;stroke:none"
99 id="rect4263"
100 width="1.6118982"
101 height="32.040779"
102 x="1.6351844"
103 y="0.0034180922"
104 ry="0" />
105</svg>

Subscribers

People subscribed via source and target branches