Merge lp:~tiagosh/messaging-app/visual-tweaks into lp:messaging-app

Proposed by Tiago Salem Herrmann
Status: Merged
Approved by: Gustavo Pichorim Boiko
Approved revision: 51
Merged at revision: 49
Proposed branch: lp:~tiagosh/messaging-app/visual-tweaks
Merge into: lp:messaging-app
Diff against target: 291 lines (+95/-55)
5 files modified
src/qml/MainPage.qml (+1/-9)
src/qml/MessageDelegate.qml (+13/-12)
src/qml/Messages.qml (+20/-11)
src/qml/ThreadDelegate.qml (+53/-23)
src/qml/messaging-app.qml (+8/-0)
To merge this branch: bzr merge lp:~tiagosh/messaging-app/visual-tweaks
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Gustavo Pichorim Boiko (community) Approve
Bill Filler (community) Approve
Review via email: mp+189957@code.launchpad.net

Commit message

- confirm before removing items
- change the selection indicator to match specs
- use animation when changing to selection mode in Messages.qml
- pop all pages from pageStack before pushing a new one

Description of the change

- confirm before removing items
- change the selection indicator to match specs
- use animation when changing to selection mode in Messages.qml
- pop all pages from pageStack before pushing a new one

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Bill Filler (bfiller) wrote :

approved

review: Approve
Revision history for this message
Bill Filler (bfiller) wrote :

more changes needded

review: Needs Fixing
Revision history for this message
Bill Filler (bfiller) wrote :

approved

review: Approve
Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

More changes arrived

Revision history for this message
Gustavo Pichorim Boiko (boiko) wrote :

Looks good and works as expected!

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/qml/MainPage.qml'
2--- src/qml/MainPage.qml 2013-09-23 21:46:58 +0000
3+++ src/qml/MainPage.qml 2013-10-10 19:29:47 +0000
4@@ -86,15 +86,7 @@
5 selectionMode: threadList.isInSelectionMode
6 selected: threadList.isSelected(threadDelegate)
7 removable: !selectionMode
8- // FIXME: the selected state should be handled by the UITK
9- Rectangle {
10- visible: selected
11- color: UbuntuColors.orange
12- opacity: 0.5
13- anchors.fill: parent
14- z: -1
15- }
16-
17+ confirmRemoval: true
18 onClicked: {
19 if (threadList.isInSelectionMode) {
20 if (!threadList.selectItem(threadDelegate)) {
21
22=== modified file 'src/qml/MessageDelegate.qml'
23--- src/qml/MessageDelegate.qml 2013-09-30 13:22:02 +0000
24+++ src/qml/MessageDelegate.qml 2013-10-10 19:29:47 +0000
25@@ -25,6 +25,7 @@
26 id: messageDelegate
27 property bool incoming: false
28 property string textColor: incoming ? "#333333" : "#ffffff"
29+ property bool selectionMode: false
30
31 anchors.left: parent ? parent.left : undefined
32 anchors.right: parent ? parent.right: undefined
33@@ -32,18 +33,18 @@
34 showDivider: false
35 highlightWhenPressed: false
36
37- backgroundIndicator: Rectangle {
38- anchors.fill: parent
39- color: Theme.palette.selected.base
40- Label {
41- text: i18n.tr("Delete")
42- anchors {
43- fill: parent
44- margins: units.gu(2)
45- }
46- verticalAlignment: Text.AlignVCenter
47- horizontalAlignment: messageDelegate.swipingState === "SwipingLeft" ? Text.AlignLeft : Text.AlignRight
48- }
49+ Icon {
50+ id: selectionIndicator
51+ visible: selectionMode
52+ name: "select"
53+ height: units.gu(3)
54+ width: units.gu(3)
55+ anchors.right: incoming ? undefined : bubble.left
56+ anchors.left: incoming ? bubble.right : undefined
57+ anchors.verticalCenter: bubble.verticalCenter
58+ anchors.leftMargin: incoming ? units.gu(2) : 0
59+ anchors.rightMargin: incoming ? 0 : units.gu(2)
60+ color: selected ? "white" : "grey"
61 }
62
63 onItemRemoved: {
64
65=== modified file 'src/qml/Messages.qml'
66--- src/qml/Messages.qml 2013-10-10 18:49:23 +0000
67+++ src/qml/Messages.qml 2013-10-10 19:29:47 +0000
68@@ -82,9 +82,16 @@
69 }
70 Button {
71 text: i18n.tr("Create new contact")
72+ color: UbuntuColors.orange
73+ onClicked: {
74+ Qt.openUrlExternally("addressbook:///create?phone=" + encodeURIComponent(contactWatcher.phoneNumber));
75+ PopupUtils.close(dialogue)
76+ }
77+ }
78+ Button {
79+ text: i18n.tr("Cancel")
80 color: UbuntuColors.warmGrey
81 onClicked: {
82- Qt.openUrlExternally("addressbook:///create?phone=" + encodeURIComponent(contactWatcher.phoneNumber));
83 PopupUtils.close(dialogue)
84 }
85 }
86@@ -321,7 +328,9 @@
87 top: newMessage.bottom
88 left: parent.left
89 right: parent.right
90- margins: units.gu(2)
91+ leftMargin: units.gu(2)
92+ bottomMargin: units.gu(2)
93+ rightMargin: units.gu(2)
94 }
95
96 states: [
97@@ -401,15 +410,9 @@
98 id: messageDelegate
99 incoming: senderId != "self"
100 selected: messageList.isSelected(messageDelegate)
101- removable: !selectionMode
102- // FIXME: the selected state should be handled by the UITK
103- Rectangle {
104- visible: selected
105- color: UbuntuColors.orange
106- opacity: 0.5
107- anchors.fill: parent
108- z: -1
109- }
110+ removable: !messages.selectionMode
111+ selectionMode: messages.selectionMode
112+ confirmRemoval: true
113 onClicked: {
114 if (messageList.isInSelectionMode) {
115 if (!messageList.selectItem(messageDelegate)) {
116@@ -444,6 +447,12 @@
117 anchors.right: parent.right
118 height: selectionMode ? 0 : textEntry.height + attachButton.height + units.gu(4)
119 visible: !selectionMode
120+ clip: true
121+
122+ Behavior on height {
123+ UbuntuNumberAnimation { }
124+ }
125+
126 ListItem.ThinDivider {
127 anchors.top: parent.top
128 }
129
130=== modified file 'src/qml/ThreadDelegate.qml'
131--- src/qml/ThreadDelegate.qml 2013-10-09 21:53:28 +0000
132+++ src/qml/ThreadDelegate.qml 2013-10-10 19:29:47 +0000
133@@ -32,22 +32,64 @@
134 anchors.right: parent.right
135 height: units.gu(10)
136
137+ // FIXME: the selected state should be handled by the UITK
138+ Item {
139+ id: selection
140+
141+ anchors {
142+ top: parent.top
143+ bottom: parent.bottom
144+ right: parent.right
145+ }
146+ width: visible ? units.gu(6) : 0
147+ opacity: selectionMode ? 1.0 : 0.0
148+ visible: opacity > 0.0
149+
150+ Behavior on width {
151+ UbuntuNumberAnimation { }
152+ }
153+
154+ Behavior on opacity {
155+ UbuntuNumberAnimation { }
156+ }
157+
158+ Rectangle {
159+ id: selectionIndicator
160+ anchors.fill: parent
161+ color: "black"
162+ opacity: 0.2
163+ }
164+
165+ Icon {
166+ anchors.centerIn: selectionIndicator
167+ name: "select"
168+ height: units.gu(3)
169+ width: units.gu(3)
170+ color: selected ? "white" : "grey"
171+
172+ Behavior on color {
173+ ColorAnimation {
174+ duration: 100
175+ }
176+ }
177+ }
178+ }
179+
180 UbuntuShape {
181 id: avatar
182- height: units.gu(7)
183- width: units.gu(7)
184+ height: units.gu(6)
185+ width: units.gu(6)
186 radius: "medium"
187 anchors {
188 left: parent.left
189- leftMargin: units.gu(1)
190+ leftMargin: units.gu(2)
191 verticalCenter: parent.verticalCenter
192 }
193-
194 image: Image {
195 property bool defaultAvatar: unknownContact || delegateHelper.avatar === ""
196 anchors.fill: parent
197 fillMode: defaultAvatar ? Image.PreserveAspectFit : Image.PreserveAspectCrop
198- source: defaultAvatar ? "image://theme/contact" : delegateHelper.avatar
199+ source: defaultAvatar ? Qt.resolvedUrl("assets/contact_defaulticon.png") : delegateHelper.avatar
200 asynchronous: true
201 }
202 }
203@@ -59,6 +101,7 @@
204 left: avatar.right
205 leftMargin: units.gu(2)
206 }
207+ fontSize: "medium"
208 text: unknownContact ? delegateHelper.phoneNumber : delegateHelper.alias
209 }
210
211@@ -66,11 +109,11 @@
212 id: time
213 anchors {
214 verticalCenter: contactName.verticalCenter
215- right: parent.right
216+ right: selection.left
217 rightMargin: units.gu(3)
218 }
219 fontSize: "x-small"
220- color: "gray"
221+ color: "white"
222 text: Qt.formatDateTime(eventTimestamp,"hh:mm AP")
223 }
224
225@@ -92,33 +135,20 @@
226 top: phoneType.bottom
227 topMargin: units.gu(0.5)
228 left: phoneType.left
229- right: parent.right
230+ right: selectionIndicator.left
231 rightMargin: units.gu(3)
232 }
233 elide: Text.ElideRight
234 maximumLineCount: 2
235- fontSize: "x-small"
236+ fontSize: "small"
237 wrapMode: Text.WordWrap
238 text: eventTextMessage == undefined ? "" : eventTextMessage
239+ opacity: 0.2
240 }
241 onItemRemoved: {
242 threadModel.removeThread(accountId, threadId, type)
243 }
244
245- backgroundIndicator: Rectangle {
246- anchors.fill: parent
247- color: Theme.palette.selected.base
248- Label {
249- text: i18n.tr("Delete")
250- anchors {
251- fill: parent
252- margins: units.gu(2)
253- }
254- verticalAlignment: Text.AlignVCenter
255- horizontalAlignment: delegate.swipingState === "SwipingLeft" ? Text.AlignLeft : Text.AlignRight
256- }
257- }
258-
259 Item {
260 id: delegateHelper
261 property alias phoneNumber: watcherInternal.phoneNumber
262
263=== added file 'src/qml/assets/contact_defaulticon@27.png'
264Binary files src/qml/assets/contact_defaulticon@27.png 1970-01-01 00:00:00 +0000 and src/qml/assets/contact_defaulticon@27.png 2013-10-10 19:29:47 +0000 differ
265=== modified file 'src/qml/assets/conversation_outgoing@18.png'
266Binary files src/qml/assets/conversation_outgoing@18.png 2013-08-12 17:51:12 +0000 and src/qml/assets/conversation_outgoing@18.png 2013-10-10 19:29:47 +0000 differ
267=== modified file 'src/qml/messaging-app.qml'
268--- src/qml/messaging-app.qml 2013-10-10 18:49:23 +0000
269+++ src/qml/messaging-app.qml 2013-10-10 19:29:47 +0000
270@@ -45,14 +45,22 @@
271 }
272 }
273
274+ function emptyStack() {
275+ while (mainStack.depth !== 1) {
276+ mainStack.pop()
277+ }
278+ }
279+
280 function startNewMessage() {
281 var properties = {}
282+ emptyStack()
283 mainStack.push(Qt.resolvedUrl("Messages.qml"), properties)
284 }
285
286 function startChat(phoneNumber) {
287 var properties = {}
288 properties["number"] = phoneNumber
289+ emptyStack()
290 mainStack.push(Qt.resolvedUrl("Messages.qml"), properties)
291 }
292

Subscribers

People subscribed via source and target branches