~renatofilho/address-book-app/fix-1511477

« back to all changes in this revision

Viewing changes to src/imports/Ubuntu/Contacts/ContactAvatar.qml

  • Committer: CI Train Bot
  • Author(s): Florian Boucault
  • Date: 2015-10-26 15:05:46 UTC
  • mfrom: (466.1.46 converged_bottom_edge)
  • Revision ID: ci-train-bot@canonical.com-20151026150546-ns9uusgkk5iyh85a
Make bottom edge usable with a mouse.
Make it smarter when more than one column is available. Fixes: #1432696

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
15
 */
16
16
 
17
 
import QtQuick 2.2
 
17
import QtQuick 2.4
18
18
import QtContacts 5.0
19
 
import Ubuntu.Components 1.2
 
19
import Ubuntu.Components 1.3
20
20
import Ubuntu.Contacts 0.1
21
21
import "Contacts.js" as ContactsJS
22
22
 
41
41
    }
42
42
 
43
43
    radius: "medium"
44
 
    color: Theme.palette.normal.overlay
 
44
    backgroundColor: Theme.palette.normal.overlay
45
45
 
46
46
    Label {
47
47
        id: initialsLabel
51
51
 
52
52
        anchors.centerIn: parent
53
53
        text: Contacts.contactInitialsFromString(contactDisplayName)
54
 
        font.pointSize: 88
55
54
        color: UbuntuColors.lightAubergine
56
55
        visible: (img.status != Image.Ready)
 
56
        fontSize: "large"
57
57
    }
58
58
 
59
 
    image: !img.visible ? img : null
 
59
    source: !img.visible ? img : null
 
60
    sourceFillMode: UbuntuShape.PreserveAspectCrop
60
61
 
61
62
    Image {
62
63
        id: img
65
66
        property string avatarUrl: ContactsJS.getAvatar(contactElement, fallbackAvatarUrl)
66
67
 
67
68
        anchors.centerIn: visible ? avatar : undefined
68
 
        fillMode: Image.PreserveAspectCrop
69
69
        asynchronous: true
70
70
        source: avatar.showAvatarPicture ? avatar.avatarUrl : ""
71
71
        height: visible ? units.gu(3) : avatar.height