Merge lp:~arashbm/cliffhanger/searchbox into lp:~flashback-dev/cliffhanger/trunk

Proposed by Arash Badie Modiri
Status: Merged
Merged at revision: 7
Proposed branch: lp:~arashbm/cliffhanger/searchbox
Merge into: lp:~flashback-dev/cliffhanger/trunk
Diff against target: 222 lines (+174/-15)
3 files modified
components/SearchBox.qml (+20/-14)
components/SearchPage.qml (+1/-1)
graphics/search_icon@8.svg (+153/-0)
To merge this branch: bzr merge lp:~arashbm/cliffhanger/searchbox
Reviewer Review Type Date Requested Status
Nekhelesh Ramananthan Approve
Review via email: mp+195211@code.launchpad.net

Description of the change

Removing search button from SearchBox component. Works with a timer like ubuntu-clock-app's SearchBox component.

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

Thanks for your contribution. This is a nice improvement. There are just some small things that need fixing.

1. The image search_icon.svg is not present in your branch. Hence when I run it, it complains that image is missing.

2. Can you replace the line 34 + width: parent.width with anchors { right: parent.right } since we are already using achors for the left and top position.

review: Needs Fixing
Revision history for this message
Arash Badie Modiri (arashbm) wrote :

> 1. The image search_icon.svg is not present in your branch. Hence when I run
> it, it complains that image is missing.
Ouch! forgot to `bzr add` the file!

lp:~arashbm/cliffhanger/searchbox updated
8. By Arash Badie Modiri

adding missing search icon

9. By Arash Badie Modiri

cleaning up SearchBox styling

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

lgtm!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'components/SearchBox.qml'
2--- components/SearchBox.qml 2013-11-12 17:43:07 +0000
3+++ components/SearchBox.qml 2013-11-14 16:12:32 +0000
4@@ -6,27 +6,33 @@
5
6 property alias defaultText: searchField.placeholderText
7 property alias search_term: searchField.text
8- signal searchClicked()
9+ signal searchTriggered()
10+
11+ Component.onCompleted: search_timer.triggered.connect(searchTriggered)
12
13 TextField {
14 id: searchField
15 anchors {
16 left: parent.left
17+ right: parent.right
18 top: parent.top
19 }
20- width: 2 * parent.width / 3
21+
22+ primaryItem: Image {
23+ height: parent.height/1.5;
24+ fillMode: Image.PreserveAspectFit
25+ source: Qt.resolvedUrl("../graphics/search_icon.svg")
26+ }
27+
28+ Timer {
29+ id: search_timer
30+ interval: 1100
31+ repeat: false
32+ }
33+
34+ placeholderText: i18n.tr("Search")
35 hasClearButton: true
36- }
37-
38- Button{
39- anchors {
40- left: searchField.right
41- top: parent.top
42- right: parent.right
43- leftMargin: units.gu(1)
44- }
45- text: "Search"
46- height: searchField.height
47- onClicked: searchBox.searchClicked()
48+ onTextChanged: search_timer.restart()
49 }
50 }
51+
52
53=== modified file 'components/SearchPage.qml'
54--- components/SearchPage.qml 2013-11-12 20:09:36 +0000
55+++ components/SearchPage.qml 2013-11-14 16:12:32 +0000
56@@ -20,7 +20,7 @@
57 right: parent.right
58 margins: units.gu(2)
59 }
60- onSearchClicked: {
61+ onSearchTriggered: {
62 _search_results.clear()
63 _searchWorker.sendMessage({"model": _search_results, "url": search_url + "&query=" + encodeURIComponent(_searchBox.search_term), "type": type})
64 }
65
66=== added file 'graphics/search_icon@8.svg'
67--- graphics/search_icon@8.svg 1970-01-01 00:00:00 +0000
68+++ graphics/search_icon@8.svg 2013-11-14 16:12:32 +0000
69@@ -0,0 +1,153 @@
70+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
71+<!-- Created with Inkscape (http://www.inkscape.org/) -->
72+
73+<svg
74+ xmlns:dc="http://purl.org/dc/elements/1.1/"
75+ xmlns:cc="http://creativecommons.org/ns#"
76+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
77+ xmlns:svg="http://www.w3.org/2000/svg"
78+ xmlns="http://www.w3.org/2000/svg"
79+ xmlns:xlink="http://www.w3.org/1999/xlink"
80+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
81+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
82+ width="32"
83+ height="32"
84+ id="svg3133"
85+ version="1.1"
86+ inkscape:version="0.48.4 r9939"
87+ sodipodi:docname="search.svg">
88+ <defs
89+ id="defs3135">
90+ <linearGradient
91+ inkscape:collect="always"
92+ id="linearGradient3803">
93+ <stop
94+ style="stop-color:#e7e5e5;stop-opacity:1;"
95+ offset="0"
96+ id="stop3805" />
97+ <stop
98+ style="stop-color:#e2dfdf;stop-opacity:1"
99+ offset="1"
100+ id="stop3807" />
101+ </linearGradient>
102+ <linearGradient
103+ inkscape:collect="always"
104+ xlink:href="#linearGradient3803"
105+ id="linearGradient3809"
106+ x1="53.012165"
107+ y1="-102.79017"
108+ x2="53.012165"
109+ y2="-66.661224"
110+ gradientUnits="userSpaceOnUse" />
111+ <linearGradient
112+ inkscape:collect="always"
113+ xlink:href="#linearGradient3803"
114+ id="linearGradient3813"
115+ gradientUnits="userSpaceOnUse"
116+ x1="53.012165"
117+ y1="-102.79017"
118+ x2="53.012165"
119+ y2="-66.661224"
120+ gradientTransform="translate(-625,0)" />
121+ </defs>
122+ <sodipodi:namedview
123+ id="base"
124+ pagecolor="#ffffff"
125+ bordercolor="#666666"
126+ borderopacity="1.0"
127+ inkscape:pageopacity="0.0"
128+ inkscape:pageshadow="2"
129+ inkscape:zoom="11.313708"
130+ inkscape:cx="27.957393"
131+ inkscape:cy="7.2819708"
132+ inkscape:document-units="px"
133+ inkscape:current-layer="g3842"
134+ showgrid="true"
135+ inkscape:window-width="1855"
136+ inkscape:window-height="1056"
137+ inkscape:window-x="65"
138+ inkscape:window-y="24"
139+ inkscape:window-maximized="1"
140+ inkscape:snap-grids="true"
141+ inkscape:snap-global="true"
142+ fit-margin-top="0"
143+ fit-margin-left="0"
144+ fit-margin-right="0"
145+ fit-margin-bottom="0"
146+ inkscape:snap-bbox="true"
147+ inkscape:bbox-paths="true"
148+ inkscape:bbox-nodes="true"
149+ inkscape:snap-bbox-edge-midpoints="true"
150+ inkscape:snap-bbox-midpoints="true"
151+ inkscape:object-paths="true"
152+ inkscape:snap-intersection-paths="true"
153+ inkscape:snap-midpoints="true"
154+ inkscape:snap-smooth-nodes="true"
155+ inkscape:object-nodes="true"
156+ inkscape:snap-object-midpoints="true"
157+ inkscape:snap-center="true">
158+ <inkscape:grid
159+ type="xygrid"
160+ id="grid3016"
161+ empspacing="6"
162+ visible="true"
163+ enabled="true"
164+ snapvisiblegridlinesonly="true"
165+ originx="-2.98e-06px"
166+ originy="2.6171874e-06px" />
167+ </sodipodi:namedview>
168+ <metadata
169+ id="metadata3138">
170+ <rdf:RDF>
171+ <cc:Work
172+ rdf:about="">
173+ <dc:format>image/svg+xml</dc:format>
174+ <dc:type
175+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
176+ <dc:title></dc:title>
177+ </cc:Work>
178+ </rdf:RDF>
179+ </metadata>
180+ <g
181+ inkscape:label="Layer 1"
182+ inkscape:groupmode="layer"
183+ id="layer1"
184+ transform="translate(-2.98e-6,-1020.3622)"
185+ style="display:inline">
186+ <g
187+ transform="matrix(0.99934414,0,0,1,-106.92982,549.00002)"
188+ id="g3842"
189+ style="display:inline">
190+ <rect
191+ style="opacity:0.05;color:#000000;fill:none;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
192+ id="rect3844"
193+ width="32.021008"
194+ height="32.000011"
195+ x="107"
196+ y="-503.36218"
197+ transform="scale(1,-1)" />
198+ <path
199+ sodipodi:type="arc"
200+ 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"
201+ id="path2995"
202+ sodipodi:cx="35.999996"
203+ sodipodi:cy="36.500011"
204+ sodipodi:rx="33"
205+ sodipodi:ry="33.5"
206+ 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"
207+ transform="matrix(0.30695569,0,0,0.30279797,111.9601,476.31005)" />
208+ <path
209+ 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"
210+ d="m 131.23812,494.07329 -1.51211,1.51111 4.26947,4.26666 1.5121,-1.5111 z"
211+ id="path3765"
212+ inkscape:connector-curvature="0"
213+ sodipodi:nodetypes="ccccc" />
214+ <path
215+ 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"
216+ 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"
217+ id="path3767"
218+ inkscape:connector-curvature="0"
219+ sodipodi:nodetypes="cscczccc" />
220+ </g>
221+ </g>
222+</svg>

Subscribers

People subscribed via source and target branches