Merge lp:~renatofilho/address-book-app/visuals-update into lp:address-book-app

Proposed by Renato Araujo Oliveira Filho
Status: Merged
Approved by: Bill Filler
Approved revision: 538
Merged at revision: 536
Proposed branch: lp:~renatofilho/address-book-app/visuals-update
Merge into: lp:address-book-app
Diff against target: 369 lines (+119/-24)
16 files modified
src/imports/Settings/SettingsPage.qml (+3/-3)
src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml (+2/-1)
src/imports/Ubuntu/AddressBook/ContactEditor/TextInputDetail.qml (+0/-1)
src/imports/Ubuntu/AddressBook/ContactView/BasicFieldView.qml (+0/-1)
src/imports/Ubuntu/Contacts/CMakeLists.txt (+1/-0)
src/imports/Ubuntu/Contacts/ContactAvatar.qml (+19/-7)
src/imports/Ubuntu/Contacts/ContactDelegate.qml (+1/-1)
src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml (+0/-2)
src/imports/Ubuntu/Contacts/ContactListButtonDelegate.qml (+0/-1)
src/imports/Ubuntu/Contacts/Contacts.js (+7/-0)
src/imports/Ubuntu/Contacts/FastScroll.qml (+20/-5)
src/imports/Ubuntu/Contacts/ListItemWithActions.qml (+1/-1)
src/imports/Ubuntu/Contacts/Triangle.qml (+52/-0)
src/imports/Ubuntu/Contacts/contacts.cpp (+5/-0)
src/imports/Ubuntu/Contacts/contacts.h (+1/-0)
tests/qml/tst_ContactAvatar.qml (+7/-1)
To merge this branch: bzr merge lp:~renatofilho/address-book-app/visuals-update
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Needs Fixing
Ubuntu Phablet Team Pending
Review via email: mp+283608@code.launchpad.net

Commit message

Use a list of colors as avatar background color.
Use flat visual for avatar ubuntu shape.
Does not use 'lightAubergine' for labels.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
533. By Renato Araujo Oliveira Filho

Update visuals for fast scrool.

534. By Renato Araujo Oliveira Filho

Update ContactAvatar test to work with the new component.

535. By Renato Araujo Oliveira Filho

Fixed warning messaging while creating ContactEditorPage.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
536. By Renato Araujo Oliveira Filho

Use a hahs of contact full name to create a better result.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
537. By Renato Araujo Oliveira Filho

Does not change the contact delegate label color to white while selected.

538. By Renato Araujo Oliveira Filho

Does not show orange rectangle on selected item in settings if no keyboard is present.

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
=== modified file 'src/imports/Settings/SettingsPage.qml'
--- src/imports/Settings/SettingsPage.qml 2016-01-05 14:04:19 +0000
+++ src/imports/Settings/SettingsPage.qml 2016-02-04 13:19:27 +0000
@@ -92,7 +92,7 @@
92 Rectangle {92 Rectangle {
93 color: UbuntuColors.orange93 color: UbuntuColors.orange
94 anchors.fill: parent94 anchors.fill: parent
95 visible:addGoogleAccountItem.activeFocus && pageStack.hasKeyboard95 visible: addGoogleAccountItem.activeFocus && pageStack.hasKeyboard
96 z: -196 z: -1
97 }97 }
98 }98 }
@@ -116,12 +116,12 @@
116 // FIXME: Using a private property here. This uses the old list item and the only way to change the text116 // FIXME: Using a private property here. This uses the old list item and the only way to change the text
117 // color is with this property.117 // color is with this property.
118 // We should remove it when update the app to the new ListItem.118 // We should remove it when update the app to the new ListItem.
119 __foregroundColor: (activeFocus && (pageStack.columns > 1)) ? Theme.palette.normal.foregroundText :119 __foregroundColor: (activeFocus && pageStack.hasKeyboard) ? Theme.palette.normal.foregroundText :
120 Theme.palette.normal.foreground120 Theme.palette.normal.foreground
121 Rectangle {121 Rectangle {
122 color: UbuntuColors.orange122 color: UbuntuColors.orange
123 anchors.fill: parent123 anchors.fill: parent
124 visible: importFromSimItem.activeFocus124 visible: importFromSimItem.activeFocus && pageStack.hasKeyboard
125 z: -1125 z: -1
126 }126 }
127 }127 }
128128
=== modified file 'src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml'
--- src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml 2016-01-07 12:21:49 +0000
+++ src/imports/Ubuntu/AddressBook/ContactEditor/ContactEditorPage.qml 2016-02-04 13:19:27 +0000
@@ -118,7 +118,8 @@
118 if (!item)118 if (!item)
119 return119 return
120120
121 var position = activeItem.mapToItem(editEditor, item.x, item.y);121
122 var position = item.mapToItem(editEditor, item.x, item.y);
122 // check if the item is already visible123 // check if the item is already visible
123 var bottomY = scrollArea.contentY + scrollArea.height124 var bottomY = scrollArea.contentY + scrollArea.height
124 var itemBottom = position.y + (item.height * 3) // extra margin125 var itemBottom = position.y + (item.height * 3) // extra margin
125126
=== modified file 'src/imports/Ubuntu/AddressBook/ContactEditor/TextInputDetail.qml'
--- src/imports/Ubuntu/AddressBook/ContactEditor/TextInputDetail.qml 2016-01-06 18:54:07 +0000
+++ src/imports/Ubuntu/AddressBook/ContactEditor/TextInputDetail.qml 2016-02-04 13:19:27 +0000
@@ -91,7 +91,6 @@
91 overlaySpacing: 091 overlaySpacing: 0
92 frameSpacing: 092 frameSpacing: 0
93 background: Item {}93 background: Item {}
94 color: UbuntuColors.lightAubergine
95 }94 }
96 onActiveFocusChanged: {95 onActiveFocusChanged: {
97 if (activeFocus) {96 if (activeFocus) {
9897
=== modified file 'src/imports/Ubuntu/AddressBook/ContactView/BasicFieldView.qml'
--- src/imports/Ubuntu/AddressBook/ContactView/BasicFieldView.qml 2015-12-10 19:13:20 +0000
+++ src/imports/Ubuntu/AddressBook/ContactView/BasicFieldView.qml 2016-02-04 13:19:27 +0000
@@ -59,7 +59,6 @@
5959
60 // style60 // style
61 fontSize: "medium"61 fontSize: "medium"
62 color: UbuntuColors.lightAubergine
63 }62 }
64 }63 }
65 }64 }
6665
=== modified file 'src/imports/Ubuntu/Contacts/CMakeLists.txt'
--- src/imports/Ubuntu/Contacts/CMakeLists.txt 2015-09-03 17:15:32 +0000
+++ src/imports/Ubuntu/Contacts/CMakeLists.txt 2016-02-04 13:19:27 +0000
@@ -31,6 +31,7 @@
31 SIMList.qml31 SIMList.qml
32 SIMCardImportPage.qml32 SIMCardImportPage.qml
33 SubtitledWithColors.qml33 SubtitledWithColors.qml
34 Triangle.qml
34 VCardParser.qml35 VCardParser.qml
35)36)
3637
3738
=== modified file 'src/imports/Ubuntu/Contacts/ContactAvatar.qml'
--- src/imports/Ubuntu/Contacts/ContactAvatar.qml 2015-10-26 13:18:11 +0000
+++ src/imports/Ubuntu/Contacts/ContactAvatar.qml 2016-02-04 13:19:27 +0000
@@ -40,8 +40,9 @@
40 initialsLabel.contactDisplayName = Qt.binding(function() { return ContactsJS.formatToDisplayWithDetails(contactElement, ContactDetail.Name, [Name.FirstName, Name.LastName], fallbackDisplayName) })40 initialsLabel.contactDisplayName = Qt.binding(function() { return ContactsJS.formatToDisplayWithDetails(contactElement, ContactDetail.Name, [Name.FirstName, Name.LastName], fallbackDisplayName) })
41 }41 }
4242
43 aspect: UbuntuShape.Flat
43 radius: "medium"44 radius: "medium"
44 backgroundColor: Theme.palette.normal.overlay45 backgroundColor: ContactsJS.contactColor(displayName)
4546
46 Label {47 Label {
47 id: initialsLabel48 id: initialsLabel
@@ -51,8 +52,8 @@
5152
52 anchors.centerIn: parent53 anchors.centerIn: parent
53 text: Contacts.contactInitialsFromString(contactDisplayName)54 text: Contacts.contactInitialsFromString(contactDisplayName)
54 color: UbuntuColors.lightAubergine55 color: "white"
55 visible: (img.status != Image.Ready)56 visible: (img.status != Image.Ready) && !fallbackIcon.visible
56 fontSize: "large"57 fontSize: "large"
57 }58 }
5859
@@ -65,13 +66,24 @@
6566
66 property string avatarUrl: ContactsJS.getAvatar(contactElement, fallbackAvatarUrl)67 property string avatarUrl: ContactsJS.getAvatar(contactElement, fallbackAvatarUrl)
6768
68 anchors.centerIn: visible ? avatar : undefined
69 asynchronous: true69 asynchronous: true
70 source: avatar.showAvatarPicture ? avatar.avatarUrl : ""70 source: avatar.showAvatarPicture && (avatar.avatarUrl.indexOf("image://theme/") === -1) ? avatar.avatarUrl : ""
71 height: visible ? units.gu(3) : avatar.height71 height: avatar.height
72 width: height72 width: height
73 visible: avatar.avatarUrl.indexOf("image://theme/") === 073 visible: false
74 sourceSize.width: avatar.width74 sourceSize.width: avatar.width
75 sourceSize.height: avatar.height75 sourceSize.height: avatar.height
76 }76 }
77
78 Icon {
79 id: fallbackIcon
80 objectName: "fallbackIcon"
81
82 source: visible ? img.avatarUrl : ""
83 visible: avatar.showAvatarPicture && (avatar.avatarUrl.indexOf("image://theme/") === 0)
84 color: "white"
85 anchors.centerIn: avatar
86 height: units.gu(3)
87 width: height
88 }
77}89}
7890
=== modified file 'src/imports/Ubuntu/Contacts/ContactDelegate.qml'
--- src/imports/Ubuntu/Contacts/ContactDelegate.qml 2015-12-10 19:13:20 +0000
+++ src/imports/Ubuntu/Contacts/ContactDelegate.qml 2016-02-04 13:19:27 +0000
@@ -76,7 +76,7 @@
76 verticalCenter: parent.verticalCenter76 verticalCenter: parent.verticalCenter
77 right: parent.right77 right: parent.right
78 }78 }
79 color: UbuntuColors.lightAubergine79 color: UbuntuColors.darkGrey
80 text: root.displayLabel != "" ? root.displayLabel : i18n.dtr("address-book-app", "No name")80 text: root.displayLabel != "" ? root.displayLabel : i18n.dtr("address-book-app", "No name")
81 elide: Text.ElideRight81 elide: Text.ElideRight
82 }82 }
8383
=== modified file 'src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml'
--- src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml 2015-10-26 13:18:11 +0000
+++ src/imports/Ubuntu/Contacts/ContactDetailPickerPhoneNumberDelegate.qml 2016-02-04 13:19:27 +0000
@@ -80,7 +80,6 @@
80 }80 }
8181
82 text: i18n.dtr("address-book-app", "Add number...")82 text: i18n.dtr("address-book-app", "Add number...")
83 color: UbuntuColors.lightAubergine
84 }83 }
85 visible: phoneNumberEntries.count == 084 visible: phoneNumberEntries.count == 0
86 MouseArea {85 MouseArea {
@@ -104,7 +103,6 @@
104 text: modelData.number103 text: modelData.number
105 subText: phoneTypeModel.get(phoneTypeModel.getTypeIndex(modelData)).label104 subText: phoneTypeModel.get(phoneTypeModel.getTypeIndex(modelData)).label
106 onClicked: root.detailClicked(modelData, "call")105 onClicked: root.detailClicked(modelData, "call")
107 textColor: UbuntuColors.lightAubergine
108106
109 MouseArea {107 MouseArea {
110 anchors {108 anchors {
111109
=== modified file 'src/imports/Ubuntu/Contacts/ContactListButtonDelegate.qml'
--- src/imports/Ubuntu/Contacts/ContactListButtonDelegate.qml 2015-10-26 13:18:11 +0000
+++ src/imports/Ubuntu/Contacts/ContactListButtonDelegate.qml 2016-02-04 13:19:27 +0000
@@ -73,7 +73,6 @@
73 right: parent.right73 right: parent.right
74 rightMargin: units.gu(2)74 rightMargin: units.gu(2)
75 }75 }
76 color: UbuntuColors.lightAubergine
77 elide: Text.ElideRight76 elide: Text.ElideRight
78 visible: root.showContents77 visible: root.showContents
79 }78 }
8079
=== modified file 'src/imports/Ubuntu/Contacts/Contacts.js'
--- src/imports/Ubuntu/Contacts/Contacts.js 2015-06-01 18:26:26 +0000
+++ src/imports/Ubuntu/Contacts/Contacts.js 2016-02-04 13:19:27 +0000
@@ -1,5 +1,6 @@
11
2var phoneTypeModel = null2var phoneTypeModel = null
3var contactColors = ["#DC3023", "#FF8936", "#FFB95A", "#8DB255", "#749F8D", "#48929B", "#A87CA0"]
34
4// Format contact name to be displayed5// Format contact name to be displayed
5function formatToDisplayWithDetails(contact, contactDetail, detailFields, defaultTitle)6function formatToDisplayWithDetails(contact, contactDetail, detailFields, defaultTitle)
@@ -145,3 +146,9 @@
145{146{
146 return (contact && (contact.contactId === "qtcontacts:::"))147 return (contact && (contact.contactId === "qtcontacts:::"))
147}148}
149
150function contactColor(name)
151{
152 var hash = Contacts.qHash(name)
153 return contactColors[(hash % contactColors.length)]
154}
148155
=== modified file 'src/imports/Ubuntu/Contacts/FastScroll.qml'
--- src/imports/Ubuntu/Contacts/FastScroll.qml 2015-12-10 19:08:19 +0000
+++ src/imports/Ubuntu/Contacts/FastScroll.qml 2016-02-04 13:19:27 +0000
@@ -72,15 +72,16 @@
72 }72 }
7373
7474
75 Rectangle {75 UbuntuShape {
76 id: magnified76 id: magnified
7777
78 aspect: UbuntuShape.Flat
78 color: Theme.palette.normal.foreground79 color: Theme.palette.normal.foreground
79 radius: height * 0.380 radius: "medium"
80 height: pinSize * 281 height: units.gu(6)
81 width: height82 width: units.gu(8)
82 opacity: internal.fastScrolling && root.enabled ? 1.0 : 0.083 opacity: internal.fastScrolling && root.enabled ? 1.0 : 0.0
83 x: -cursor.width - units.gu(3)84 x: -magnified.width
84 y: {85 y: {
85 if (internal.currentItem) {86 if (internal.currentItem) {
86 var itemCenterY = rail.y + internal.currentItem.y + (internal.currentItem.height / 2)87 var itemCenterY = rail.y + internal.currentItem.y + (internal.currentItem.height / 2)
@@ -90,6 +91,20 @@
90 }91 }
91 }92 }
9293
94 Triangle {
95 id: arrow
96
97 color: magnified.color
98 fill: true
99 height: units.gu(1.5)
100 width: units.gu(0.5)
101 anchors {
102 verticalCenter: parent.verticalCenter
103 right: parent.right
104 rightMargin: -width
105 }
106 }
107
93 Label {108 Label {
94 color: Theme.palette.normal.foregroundText109 color: Theme.palette.normal.foregroundText
95 anchors.fill: parent110 anchors.fill: parent
96111
=== modified file 'src/imports/Ubuntu/Contacts/ListItemWithActions.qml'
--- src/imports/Ubuntu/Contacts/ListItemWithActions.qml 2016-01-06 15:09:18 +0000
+++ src/imports/Ubuntu/Contacts/ListItemWithActions.qml 2016-02-04 13:19:27 +0000
@@ -246,7 +246,7 @@
246 width: units.gu(3)246 width: units.gu(3)
247 height: units.gu(3)247 height: units.gu(3)
248 name: modelData.iconName248 name: modelData.iconName
249 color: root.activeAction === modelData ? UbuntuColors.lightAubergine : UbuntuColors.lightGrey249 color: root.activeAction === modelData ? UbuntuColors.orange : UbuntuColors.lightGrey
250 }250 }
251 }251 }
252 }252 }
253253
=== added file 'src/imports/Ubuntu/Contacts/Triangle.qml'
--- src/imports/Ubuntu/Contacts/Triangle.qml 1970-01-01 00:00:00 +0000
+++ src/imports/Ubuntu/Contacts/Triangle.qml 2016-02-04 13:19:27 +0000
@@ -0,0 +1,52 @@
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17import QtQuick 2.4
18
19Canvas {
20 id: triangle
21 antialiasing: true
22
23 property color color: "#ffffff"
24 property int lineWidth: 3
25 property bool fill: false
26
27 onLineWidthChanged:requestPaint();
28 onFillChanged:requestPaint();
29
30 onPaint: {
31 var ctx = getContext("2d");
32 ctx.save();
33 ctx.clearRect(0,0,triangle.width, triangle.height);
34 ctx.strokeStyle = triangle.color;
35 ctx.lineWidth = triangle.lineWidth
36 ctx.fillStyle = triangle.color
37 ctx.globalAlpha = 1.0
38 ctx.lineJoin = "round";
39 ctx.beginPath();
40
41 ctx.translate(0, 0);
42 ctx.lineTo(0, triangle.height);
43 ctx.lineTo(triangle.width, 0.5 * triangle.height);
44 ctx.lineTo(0, 0);
45
46 if (triangle.fill)
47 ctx.fill();
48 if (triangle.stroke)
49 ctx.stroke();
50 ctx.restore();
51 }
52}
053
=== modified file 'src/imports/Ubuntu/Contacts/contacts.cpp'
--- src/imports/Ubuntu/Contacts/contacts.cpp 2015-10-28 19:42:30 +0000
+++ src/imports/Ubuntu/Contacts/contacts.cpp 2016-02-04 13:19:27 +0000
@@ -109,6 +109,11 @@
109 return QFile::exists(updaterLockFile());109 return QFile::exists(updaterLockFile());
110}110}
111111
112uint UbuntuContacts::qHash(const QString &str)
113{
114 return ::qHash(str);
115}
116
112QString UbuntuContacts::updaterLockFile()117QString UbuntuContacts::updaterLockFile()
113{118{
114 return QString("%1/%2").arg(QDir::tempPath()).arg("/address-book-updater.lock");119 return QString("%1/%2").arg(QDir::tempPath()).arg("/address-book-updater.lock");
115120
=== modified file 'src/imports/Ubuntu/Contacts/contacts.h'
--- src/imports/Ubuntu/Contacts/contacts.h 2015-10-28 19:42:30 +0000
+++ src/imports/Ubuntu/Contacts/contacts.h 2016-02-04 13:19:27 +0000
@@ -40,6 +40,7 @@
40 Q_INVOKABLE bool containsLetters(const QString &value);40 Q_INVOKABLE bool containsLetters(const QString &value);
41 Q_INVOKABLE bool removeFile(const QUrl &file);41 Q_INVOKABLE bool removeFile(const QUrl &file);
42 Q_INVOKABLE bool updateIsRunning() const;42 Q_INVOKABLE bool updateIsRunning() const;
43 Q_INVOKABLE uint qHash(const QString &str);
4344
44Q_SIGNALS:45Q_SIGNALS:
45 void imageCopyDone(const QString &id, const QString &fileName);46 void imageCopyDone(const QString &id, const QString &fileName);
4647
=== modified file 'tests/qml/tst_ContactAvatar.qml'
--- tests/qml/tst_ContactAvatar.qml 2015-10-26 13:18:11 +0000
+++ tests/qml/tst_ContactAvatar.qml 2016-02-04 13:19:27 +0000
@@ -151,14 +151,20 @@
151 waitForRendering(avatarComponent);151 waitForRendering(avatarComponent);
152 var avatarInitials = findChild(avatarComponent, "avatarInitials")152 var avatarInitials = findChild(avatarComponent, "avatarInitials")
153 var avatarImage = findChild(avatarComponent, "avatarImage")153 var avatarImage = findChild(avatarComponent, "avatarImage")
154 var avatarFallback = findChild(avatarComponent, "fallbackIcon")
154155
155 avatarComponent.showAvatarPicture = true156 avatarComponent.showAvatarPicture = true
156 tryCompare(avatarInitials, "visible", false)157 tryCompare(avatarInitials, "visible", false)
157 tryCompare(avatarImage, "source", avatarComponent.fallbackAvatarUrl)158 tryCompare(avatarImage, "source", "")
159 tryCompare(avatarFallback, "visible", true)
160 tryCompare(avatarFallback, "source", avatarComponent.fallbackAvatarUrl)
158161
159 avatarComponent.showAvatarPicture = false162 avatarComponent.showAvatarPicture = false
160 tryCompare(avatarImage, "source", "")163 tryCompare(avatarImage, "source", "")
161 tryCompare(avatarImage, "status", Image.Null)164 tryCompare(avatarImage, "status", Image.Null)
165 tryCompare(avatarFallback, "visible", false)
166 tryCompare(avatarFallback, "source", "")
167
162 tryCompare(avatarInitials, "visible", true)168 tryCompare(avatarInitials, "visible", true)
163 }169 }
164 }170 }

Subscribers

People subscribed via source and target branches