[Merge] lp:~boiko/messaging-app/compose_bar into lp:messaging-app
Tiago Salem Herrmann
tiago.herrmann at canonical.com
Wed Nov 25 18:27:59 UTC 2015
Review: Needs Fixing
Diff comments:
>
> === added file 'src/qml/ThumbnailContact.qml'
> --- src/qml/ThumbnailContact.qml 1970-01-01 00:00:00 +0000
> +++ src/qml/ThumbnailContact.qml 2015-11-24 12:13:35 +0000
> @@ -0,0 +1,88 @@
> +import QtQuick 2.0
> +import Ubuntu.Components 1.2
Shouldn't we use 1.3 here?
> +import Ubuntu.Contacts 0.1
> +
> +Item {
> + id: attachment
> +
> + readonly property int contactsCount:vcardParser.contacts ? vcardParser.contacts.length : 0
> + property int index
> + property string filePath
> + property alias vcard: vcardParser
> + property string contactDisplayName: {
> + if (contactsCount > 0) {
> + var contact = vcard.contacts[0]
> + if (contact.displayLabel.label && (contact.displayLabel.label != "")) {
> + return contact.displayLabel.label
> + } else if (contact.name) {
> + var contacFullName = contact.name.firstName
> + if (contact.name.midleName) {
> + contacFullName += " " + contact.name.midleName
> + }
> + if (contact.name.lastName) {
> + contacFullName += " " + contact.name.lastName
> + }
> + return contacFullName
> + }
> + return i18n.tr("Unknown contact")
> + }
> + return ""
> + }
> + property string title: {
> + var result = attachment.contactDisplayName
> + if (attachment.contactsCount > 1) {
> + return result + " (+%1)".arg(attachment.contactsCount-1)
> + } else {
> + return result
> + }
> + }
> +
> + height: units.gu(6)
> + width: textEntry.width
> +
> + ContactAvatar {
> + id: avatar
> +
> + anchors {
> + top: parent.top
> + bottom: parent.bottom
> + left: parent.left
> + }
> + contactElement: attachment.contactsCount === 1 ? attachment.vcard.contacts[0] : null
> + fallbackAvatarUrl: attachment.contactsCount === 1 ? "image://theme/contact" : "image://theme/contact-group"
> + fallbackDisplayName: attachment.contactsCount === 1 ? attachment.contactDisplayName : ""
> + width: height
> + }
> + Label {
> + id: label
> +
> + anchors {
> + left: avatar.right
> + leftMargin: units.gu(1)
> + top: avatar.top
> + bottom: avatar.bottom
> + right: parent.right
> + rightMargin: units.gu(1)
> + }
> +
> + verticalAlignment: Text.AlignVCenter
> + text: attachment.title
> + elide: Text.ElideMiddle
> + color: UbuntuColors.lightAubergine
> + }
> + MouseArea {
> + anchors.fill: parent
> + onPressAndHold: {
> + mouse.accept = true
> + Qt.inputMethod.hide()
> + activeAttachmentIndex = index
> + PopupUtils.open(attachmentPopover, parent)
> + }
> + }
> + VCardParser {
> + id: vcardParser
> +
> + vCardUrl: attachment ? Qt.resolvedUrl(attachment.filePath) : ""
> + }
> +}
> +
>
> === added file 'src/qml/ThumbnailImage.qml'
> --- src/qml/ThumbnailImage.qml 1970-01-01 00:00:00 +0000
> +++ src/qml/ThumbnailImage.qml 2015-11-24 12:13:35 +0000
> @@ -0,0 +1,31 @@
> +import QtQuick 2.0
> +import Ubuntu.Components 1.2
same here.
> +
> +UbuntuShape {
> + id: thumbnail
> + property int index
> + property string filePath
> +
> + signal pressAndHold()
> +
> + width: childrenRect.width
> + height: childrenRect.height
> +
> + image: Image {
> + id: avatarImage
> + width: units.gu(8)
> + height: units.gu(8)
> + sourceSize.height: height
> + sourceSize.width: width
> + fillMode: Image.PreserveAspectCrop
> + source: filePath
> + asynchronous: true
> + }
> + MouseArea {
> + anchors.fill: parent
> + onPressAndHold: {
> + mouse.accept = true
> + thumbnail.pressAndHold()
> + }
> + }
> +}
>
> === added file 'src/qml/ThumbnailUnknown.qml'
> --- src/qml/ThumbnailUnknown.qml 1970-01-01 00:00:00 +0000
> +++ src/qml/ThumbnailUnknown.qml 2015-11-24 12:13:35 +0000
> @@ -0,0 +1,27 @@
> +import QtQuick 2.0
> +import Ubuntu.Components 1.2
And here.
> +
> +UbuntuShape {
> + id: thumbnail
> + property int index
> + property string filePath
> +
> + signal pressAndHold()
> +
> + width: units.gu(8)
> + height: units.gu(8)
> +
> + Icon {
> + anchors.centerIn: parent
> + width: units.gu(6)
> + height: units.gu(6)
> + name: "attachment"
> + }
> + MouseArea {
> + anchors.fill: parent
> + onPressAndHold: {
> + mouse.accept = true
> + thumbnail.pressAndHold()
> + }
> + }
> +}
--
https://code.launchpad.net/~boiko/messaging-app/compose_bar/+merge/278208
Your team Ubuntu Phablet Team is subscribed to branch lp:messaging-app.
More information about the Ubuntu-reviews
mailing list