Merge lp:~boiko/messaging-app/fix_bubble into lp:messaging-app
- fix_bubble
- Merge into trunk
Status: | Merged |
---|---|
Merged at revision: | 499 |
Proposed branch: | lp:~boiko/messaging-app/fix_bubble |
Merge into: | lp:messaging-app |
Prerequisite: | lp:~tiagosh/messaging-app/checkmarks |
Diff against target: |
364 lines (+127/-95) 10 files modified
src/qml/DeliveryStatus.qml (+3/-2) src/qml/MMS/MMSContact.qml (+2/-2) src/qml/MessageBubble.qml (+58/-88) src/qml/assets/blue_bubble@27.sci (+5/-0) src/qml/assets/double_tick.svg (+21/-0) src/qml/assets/green_bubble@27.sci (+5/-0) src/qml/assets/red_bubble@27.sci (+5/-0) src/qml/assets/single_tick.svg (+20/-0) src/qml/assets/white_bubble@27.sci (+5/-0) tests/qml/tst_MessageBubble.qml (+3/-3) |
To merge this branch: | bzr merge lp:~boiko/messaging-app/fix_bubble |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Needs Fixing | |
Tiago Salem Herrmann | Pending | ||
Review via email: mp+280015@code.launchpad.net |
This proposal supersedes a proposal from 2015-11-24.
Commit message
Update the bubble to match the designs.
Description of the change
Update the bubble to match the designs.
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
Tiago Salem Herrmann (tiagosh) wrote : Posted in a previous version of this proposal | # |
Looks good, one small remark.
Gustavo Pichorim Boiko (boiko) : Posted in a previous version of this proposal | # |
PS Jenkins bot (ps-jenkins) wrote : Posted in a previous version of this proposal | # |
FAILED: Continuous integration, rev:479
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Tiago Salem Herrmann (tiagosh) wrote : Posted in a previous version of this proposal | # |
Looks good now.
Thanks.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:480
http://
Executed test runs:
UNSTABLE: http://
FAILURE: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:481
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 482. By Gustavo Pichorim Boiko
-
Update the bubbles according to the designs.
- 483. By Gustavo Pichorim Boiko
-
Fix tests.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:483
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'src/qml/DeliveryStatus.qml' |
2 | --- src/qml/DeliveryStatus.qml 2015-12-16 13:18:12 +0000 |
3 | +++ src/qml/DeliveryStatus.qml 2015-12-16 13:18:12 +0000 |
4 | @@ -22,15 +22,16 @@ |
5 | property int status: -1 |
6 | property bool enabled: true |
7 | height: enabled ? units.gu(1) : 0 |
8 | + width: enabled ? undefined : 0 |
9 | fillMode: Image.PreserveAspectFit |
10 | source: { |
11 | if (!enabled) { |
12 | return "" |
13 | } |
14 | if (status == HistoryThreadModel.MessageStatusDelivered) { |
15 | - return Qt.resolvedUrl("./assets/check_single_white.png") |
16 | + return Qt.resolvedUrl("./assets/single_tick.svg") |
17 | } else if (status == HistoryThreadModel.MessageStatusRead) { |
18 | - return Qt.resolvedUrl("./assets/check_double_white.png") |
19 | + return Qt.resolvedUrl("./assets/double_tick.svg") |
20 | } |
21 | return "" |
22 | } |
23 | |
24 | === modified file 'src/qml/MMS/MMSContact.qml' |
25 | --- src/qml/MMS/MMSContact.qml 2015-12-16 13:18:12 +0000 |
26 | +++ src/qml/MMS/MMSContact.qml 2015-12-16 13:18:12 +0000 |
27 | @@ -77,8 +77,8 @@ |
28 | return "#3fb24f" |
29 | } |
30 | } |
31 | - border.color: "#ACACAC" |
32 | - radius: height * 0.1 |
33 | + border.color: incoming ? "#ACACAC" : "transparent" |
34 | + radius: units.gu(1) |
35 | |
36 | ContactAvatar { |
37 | id: avatar |
38 | |
39 | === modified file 'src/qml/MessageBubble.qml' |
40 | --- src/qml/MessageBubble.qml 2015-12-16 13:18:12 +0000 |
41 | +++ src/qml/MessageBubble.qml 2015-12-16 13:18:12 +0000 |
42 | @@ -24,7 +24,7 @@ |
43 | import "dateUtils.js" as DateUtils |
44 | import "3rd_party/ba-linkify.js" as BaLinkify |
45 | |
46 | -Rectangle { |
47 | +BorderImage { |
48 | id: root |
49 | |
50 | property int messageStatus: -1 |
51 | @@ -74,28 +74,33 @@ |
52 | return text |
53 | } |
54 | |
55 | - color: { |
56 | + property string color: { |
57 | if (error) { |
58 | - return "#fc4949" |
59 | + return "red" |
60 | } else if (sending) { |
61 | - return "#b2b2b2" |
62 | + return "gray" |
63 | } else if (messageIncoming) { |
64 | - return "#ffffff" |
65 | + return "white" |
66 | } else { |
67 | - return "#3fb24f" |
68 | + // FIXME: use blue for IM accounts |
69 | + return "green" |
70 | } |
71 | } |
72 | - border.color: "#ACACAC" |
73 | - |
74 | - radius: units.gu(1) |
75 | - height: senderName.height + senderName.anchors.topMargin + textLabel.height + textTimestamp.height + units.gu(1) |
76 | + source: "assets/" + color + "_bubble.sci" |
77 | + smooth: true |
78 | + |
79 | + // FIXME: maybe we should put everything inside a container to make width and height calculation easier |
80 | + height: senderName.height + senderName.anchors.topMargin + textLabel.height + border.bottom + units.gu(0.5) + (oneLine ? 0 : messageFooter.height + messageFooter.anchors.topMargin) |
81 | + |
82 | + // if possible, put the timestamp and the delivery status in the same line as the text |
83 | + property int oneLineWidth: textLabel.contentWidth + messageFooter.width |
84 | + property bool oneLine: oneLineWidth <= units.gu(27) |
85 | width: Math.min(units.gu(27), |
86 | - Math.max(textLabel.contentWidth, textTimestamp.contentWidth + deliveryStatus.width, senderName.contentWidth)) |
87 | + Math.max(oneLine ? oneLineWidth : textLabel.contentWidth, |
88 | + messageFooter.width, |
89 | + senderName.contentWidth, |
90 | + border.right + border.left - units.gu(3))) |
91 | + units.gu(3) |
92 | - anchors{ |
93 | - leftMargin: units.gu(1) |
94 | - rightMargin: units.gu(1) |
95 | - } |
96 | |
97 | Label { |
98 | id: senderName |
99 | @@ -131,84 +136,49 @@ |
100 | color: root.messageIncoming ? UbuntuColors.darkGrey : "white" |
101 | } |
102 | |
103 | - Label { |
104 | - id: textTimestamp |
105 | - objectName: "messageDate" |
106 | + Row { |
107 | + id: messageFooter |
108 | + width: childrenRect.width |
109 | + spacing: units.gu(1) |
110 | |
111 | - anchors{ |
112 | + anchors { |
113 | top: textLabel.bottom |
114 | - topMargin: units.gu(0.5) |
115 | - left: parent.left |
116 | - leftMargin: units.gu(1) |
117 | + topMargin: oneLine ? -textTimestamp.height : units.gu(0.5) |
118 | + right: parent.right |
119 | + rightMargin: units.gu(1) |
120 | } |
121 | |
122 | - visible: !root.sending |
123 | - height: units.gu(2) |
124 | - width: visible ? maxDelegateWidth : 0 |
125 | - fontSize: "xx-small" |
126 | - color: root.messageIncoming ? UbuntuColors.lightGrey : "white" |
127 | - opacity: root.messageIncoming ? 1.0 : 0.8 |
128 | - elide: Text.ElideRight |
129 | - text: { |
130 | - if (messageTimeStamp === "") |
131 | - return "" |
132 | - |
133 | - var str = Qt.formatTime(messageTimeStamp, Qt.DefaultLocaleShortDate) |
134 | - if (root.accountName.length === 0 || !root.messageIncoming) { |
135 | + Label { |
136 | + id: textTimestamp |
137 | + objectName: "messageDate" |
138 | + |
139 | + anchors.bottom: parent.bottom |
140 | + visible: !root.sending |
141 | + height: units.gu(2) |
142 | + width: paintedWidth > maxDelegateWidth ? maxDelegateWidth : undefined |
143 | + fontSize: "xx-small" |
144 | + color: root.messageIncoming ? UbuntuColors.lightGrey : "white" |
145 | + opacity: root.messageIncoming ? 1.0 : 0.8 |
146 | + elide: Text.ElideRight |
147 | + verticalAlignment: Text.AlignVCenter |
148 | + text: { |
149 | + if (messageTimeStamp === "") |
150 | + return "" |
151 | + |
152 | + var str = Qt.formatTime(messageTimeStamp, Qt.DefaultLocaleShortDate) |
153 | + if (root.accountName.length === 0 || !root.messageIncoming) { |
154 | + return str |
155 | + } |
156 | + str += " @ %1".arg(root.accountName) |
157 | return str |
158 | } |
159 | - str += " @ %1".arg(root.accountName) |
160 | - return str |
161 | - } |
162 | - } |
163 | - |
164 | - DeliveryStatus { |
165 | - id: deliveryStatus |
166 | - status: messageStatus |
167 | - enabled: deliveryStatusAvailable |
168 | - anchors { |
169 | - right: parent.right |
170 | - rightMargin: units.gu(0.5) |
171 | - verticalCenter: textTimestamp.verticalCenter |
172 | - } |
173 | - } |
174 | - |
175 | - ColoredImage { |
176 | - id: bubbleArrow |
177 | - |
178 | - source: Qt.resolvedUrl("./assets/conversation_bubble_arrow.png") |
179 | - color: root.color |
180 | - asynchronous: false |
181 | - anchors { |
182 | - bottom: parent.bottom |
183 | - bottomMargin: units.gu(2) |
184 | - leftMargin: -1 |
185 | - rightMargin: -1 |
186 | - } |
187 | - width: units.gu(1) |
188 | - height: units.gu(1.5) |
189 | - |
190 | - states: [ |
191 | - State { |
192 | - when: root.messageIncoming |
193 | - name: "incoming" |
194 | - AnchorChanges { |
195 | - target: bubbleArrow |
196 | - anchors.right: root.left |
197 | - } |
198 | - }, |
199 | - State { |
200 | - when: !root.messageIncoming |
201 | - name: "outgoing" |
202 | - AnchorChanges { |
203 | - target: bubbleArrow |
204 | - anchors.left: root.right |
205 | - } |
206 | - PropertyChanges { |
207 | - target: bubbleArrow |
208 | - mirror: true |
209 | - } |
210 | - } |
211 | - ] |
212 | + } |
213 | + |
214 | + DeliveryStatus { |
215 | + id: deliveryStatus |
216 | + status: messageStatus |
217 | + enabled: deliveryStatusAvailable |
218 | + anchors.verticalCenter: textTimestamp.verticalCenter |
219 | + } |
220 | } |
221 | } |
222 | |
223 | === added file 'src/qml/assets/blue_bubble@27.png' |
224 | Binary files src/qml/assets/blue_bubble@27.png 1970-01-01 00:00:00 +0000 and src/qml/assets/blue_bubble@27.png 2015-12-16 13:18:12 +0000 differ |
225 | === added file 'src/qml/assets/blue_bubble@27.sci' |
226 | --- src/qml/assets/blue_bubble@27.sci 1970-01-01 00:00:00 +0000 |
227 | +++ src/qml/assets/blue_bubble@27.sci 2015-12-16 13:18:12 +0000 |
228 | @@ -0,0 +1,5 @@ |
229 | +border.left:135 |
230 | +border.top: 27 |
231 | +border.bottom: 48 |
232 | +border.right: 135 |
233 | +source: blue_bubble@27.png |
234 | \ No newline at end of file |
235 | |
236 | === added file 'src/qml/assets/blue_bubble@27_1.png' |
237 | Binary files src/qml/assets/blue_bubble@27_1.png 1970-01-01 00:00:00 +0000 and src/qml/assets/blue_bubble@27_1.png 2015-12-16 13:18:12 +0000 differ |
238 | === removed file 'src/qml/assets/check_double_white.png' |
239 | Binary files src/qml/assets/check_double_white.png 2015-12-16 13:18:12 +0000 and src/qml/assets/check_double_white.png 1970-01-01 00:00:00 +0000 differ |
240 | === removed file 'src/qml/assets/check_single_white.png' |
241 | Binary files src/qml/assets/check_single_white.png 2015-12-16 13:18:12 +0000 and src/qml/assets/check_single_white.png 1970-01-01 00:00:00 +0000 differ |
242 | === removed file 'src/qml/assets/conversation_bubble_arrow.png' |
243 | Binary files src/qml/assets/conversation_bubble_arrow.png 2015-08-17 17:39:45 +0000 and src/qml/assets/conversation_bubble_arrow.png 1970-01-01 00:00:00 +0000 differ |
244 | === added file 'src/qml/assets/double_tick.svg' |
245 | --- src/qml/assets/double_tick.svg 1970-01-01 00:00:00 +0000 |
246 | +++ src/qml/assets/double_tick.svg 2015-12-16 13:18:12 +0000 |
247 | @@ -0,0 +1,21 @@ |
248 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
249 | +<svg width="52px" height="28px" viewBox="0 0 52 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns"> |
250 | + <!-- Generator: Sketch 3.4.2 (15857) - http://www.bohemiancoding.com/sketch --> |
251 | + <title>path4041-9 copy + path4041-9 copy 2</title> |
252 | + <desc>Created with Sketch.</desc> |
253 | + <defs></defs> |
254 | + <g id="Messaging" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage"> |
255 | + <g id="Compose-SMS-empty-state-Copy-56" sketch:type="MSArtboardGroup" transform="translate(-948.000000, -512.000000)" fill="#FFFFFF"> |
256 | + <g id="tick" sketch:type="MSLayerGroup" transform="translate(941.000000, 499.000000)"> |
257 | + <g id="svg4874" sketch:type="MSShapeGroup"> |
258 | + <g id="layer1"> |
259 | + <g id="path4041-9-copy-+-path4041-9-copy-2" transform="translate(7.000000, 13.000000)"> |
260 | + <path d="M15.3523623,21.1776844 L1.97756181,9.70609227 L0.120056,11.8063782 L15.3437936,27.824149 L39.756042,2.13611253 L38.5926018,0.824149 L15.3523623,21.1776844 Z" id="path4041-9-copy"></path> |
261 | + <path d="M27.3523623,21.1776844 L13.9775618,9.70609227 L12.120056,11.8063782 L27.3437936,27.824149 L51.756042,2.13611253 L50.5926018,0.824149 L27.3523623,21.1776844 Z" id="path4041-9-copy-2"></path> |
262 | + </g> |
263 | + </g> |
264 | + </g> |
265 | + </g> |
266 | + </g> |
267 | + </g> |
268 | +</svg> |
269 | \ No newline at end of file |
270 | |
271 | === added file 'src/qml/assets/green_bubble@27.png' |
272 | Binary files src/qml/assets/green_bubble@27.png 1970-01-01 00:00:00 +0000 and src/qml/assets/green_bubble@27.png 2015-12-16 13:18:12 +0000 differ |
273 | === added file 'src/qml/assets/green_bubble@27.sci' |
274 | --- src/qml/assets/green_bubble@27.sci 1970-01-01 00:00:00 +0000 |
275 | +++ src/qml/assets/green_bubble@27.sci 2015-12-16 13:18:12 +0000 |
276 | @@ -0,0 +1,5 @@ |
277 | +border.left:135 |
278 | +border.top: 27 |
279 | +border.bottom: 48 |
280 | +border.right: 135 |
281 | +source: green_bubble@27.png |
282 | |
283 | === added file 'src/qml/assets/red_bubble@27.png' |
284 | Binary files src/qml/assets/red_bubble@27.png 1970-01-01 00:00:00 +0000 and src/qml/assets/red_bubble@27.png 2015-12-16 13:18:12 +0000 differ |
285 | === added file 'src/qml/assets/red_bubble@27.sci' |
286 | --- src/qml/assets/red_bubble@27.sci 1970-01-01 00:00:00 +0000 |
287 | +++ src/qml/assets/red_bubble@27.sci 2015-12-16 13:18:12 +0000 |
288 | @@ -0,0 +1,5 @@ |
289 | +border.left:135 |
290 | +border.top: 27 |
291 | +border.bottom: 48 |
292 | +border.right: 135 |
293 | +source: red_bubble@27.png |
294 | \ No newline at end of file |
295 | |
296 | === added file 'src/qml/assets/red_bubble@27_1.png' |
297 | Binary files src/qml/assets/red_bubble@27_1.png 1970-01-01 00:00:00 +0000 and src/qml/assets/red_bubble@27_1.png 2015-12-16 13:18:12 +0000 differ |
298 | === added file 'src/qml/assets/single_tick.svg' |
299 | --- src/qml/assets/single_tick.svg 1970-01-01 00:00:00 +0000 |
300 | +++ src/qml/assets/single_tick.svg 2015-12-16 13:18:12 +0000 |
301 | @@ -0,0 +1,20 @@ |
302 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
303 | +<svg width="40px" height="28px" viewBox="0 0 40 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sketch="http://www.bohemiancoding.com/sketch/ns"> |
304 | + <!-- Generator: Sketch 3.4.2 (15857) - http://www.bohemiancoding.com/sketch --> |
305 | + <title>path4041-9</title> |
306 | + <desc>Created with Sketch.</desc> |
307 | + <defs></defs> |
308 | + <g id="Messaging" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd" sketch:type="MSPage"> |
309 | + <g id="Compose-SMS-empty-state-Copy-54" sketch:type="MSArtboardGroup" transform="translate(-961.000000, -512.000000)" fill="#FFFFFF"> |
310 | + <g id="bubble-1" sketch:type="MSLayerGroup" transform="translate(535.000000, 373.500000)"> |
311 | + <g id="tick" transform="translate(426.000000, 138.500000)" sketch:type="MSShapeGroup"> |
312 | + <g id="svg4874"> |
313 | + <g id="layer1"> |
314 | + <path d="M15.3523623,21.1776844 L1.97756181,9.70609227 L0.120056,11.8063782 L15.3437936,27.824149 L39.756042,2.13611253 L38.5926018,0.824149 L15.3523623,21.1776844 Z" id="path4041-9"></path> |
315 | + </g> |
316 | + </g> |
317 | + </g> |
318 | + </g> |
319 | + </g> |
320 | + </g> |
321 | +</svg> |
322 | \ No newline at end of file |
323 | |
324 | === added file 'src/qml/assets/white_bubble@27.png' |
325 | Binary files src/qml/assets/white_bubble@27.png 1970-01-01 00:00:00 +0000 and src/qml/assets/white_bubble@27.png 2015-12-16 13:18:12 +0000 differ |
326 | === added file 'src/qml/assets/white_bubble@27.sci' |
327 | --- src/qml/assets/white_bubble@27.sci 1970-01-01 00:00:00 +0000 |
328 | +++ src/qml/assets/white_bubble@27.sci 2015-12-16 13:18:12 +0000 |
329 | @@ -0,0 +1,5 @@ |
330 | +border.left:143 |
331 | +border.top: 27 |
332 | +border.bottom: 48 |
333 | +border.right: 135 |
334 | +source: white_bubble@27.png |
335 | |
336 | === added file 'src/qml/assets/white_bubble@27_1.png' |
337 | Binary files src/qml/assets/white_bubble@27_1.png 1970-01-01 00:00:00 +0000 and src/qml/assets/white_bubble@27_1.png 2015-12-16 13:18:12 +0000 differ |
338 | === modified file 'tests/qml/tst_MessageBubble.qml' |
339 | --- tests/qml/tst_MessageBubble.qml 2014-08-27 17:50:35 +0000 |
340 | +++ tests/qml/tst_MessageBubble.qml 2015-12-16 13:18:12 +0000 |
341 | @@ -73,20 +73,20 @@ |
342 | function test_incomingMessageBubbleMustUseIncomingSource() { |
343 | var incomingMessageBubble = findChild( |
344 | root, 'incomingMessageBubble'); |
345 | - compare(incomingMessageBubble.color, "#ffffff") |
346 | + compare(incomingMessageBubble.color, "white") |
347 | } |
348 | |
349 | function test_outgoingMessageBubbleMustUseOutgoingSource() { |
350 | var outgoingMessageBubble = findChild( |
351 | root, 'outgoingMessageBubble'); |
352 | - compare(outgoingMessageBubble.color, "#3fb24f") |
353 | + compare(outgoingMessageBubble.color, "green") |
354 | } |
355 | |
356 | function test_changeIncomingMustUpdateSource() { |
357 | var changeIncomingMessageBubble = findChild( |
358 | root, 'changeIncomingMessageBubble'); |
359 | changeIncomingMessageBubble.messageIncoming = false; |
360 | - compare(changeIncomingMessageBubble.color, "#3fb24f") |
361 | + compare(changeIncomingMessageBubble.color, "green") |
362 | } |
363 | } |
364 | } |
FAILED: Continuous integration, rev:478 jenkins. qa.ubuntu. com/job/ messaging- app-ci/ 748/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- vivid-touch/ 5391 jenkins. qa.ubuntu. com/job/ messaging- app-vivid- i386-ci/ 257 jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- runner- vivid-touch/ 4262 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 5405 jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- vivid-armhf/ 5405/artifact/ work/output/ *zip*/output. zip s-jenkins. ubuntu- ci:8080/ job/touch- flash-device/ 25474
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
UNSTABLE: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/messaging- app-ci/ 748/rebuild
http://