From 0114c54ff12d7f9cecf4637ba1d43b5e887a736f Mon Sep 17 00:00:00 2001 From: link2xt Date: Sun, 15 Aug 2021 00:01:24 +0000 Subject: Add avatars to New Chat page --- qml/NewChatPage.qml | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) (limited to 'qml/NewChatPage.qml') diff --git a/qml/NewChatPage.qml b/qml/NewChatPage.qml index cc14185..d848c17 100644 --- a/qml/NewChatPage.qml +++ b/qml/NewChatPage.qml @@ -1,7 +1,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 import QtQuick.Layouts 1.12 -import org.kde.kirigami 2.12 as Kirigami +import org.kde.kirigami 2.13 as Kirigami import DeltaChat 1.0 @@ -40,11 +40,31 @@ Kirigami.ScrollablePage { model: contactsModel currentIndex: -1 - delegate: Kirigami.BasicListItem { + delegate: Kirigami.AbstractListItem { property DcContact contact: context.getContact(model.contactId) - - label: contact.displayName - subtitle: contact.addr + property string profileImage: contact.getProfileImage() + + RowLayout { + Kirigami.Avatar { + name: contact.displayName + color: contact.color + source: profileImage ? "file:" + profileImage : "" + } + + ColumnLayout { + Layout.fillWidth: true + Label { + text: contact.displayName + font.weight: Font.Bold + Layout.fillWidth: true + } + Label { + text: contact.addr + font: Kirigami.Theme.smallFont + Layout.fillWidth: true + } + } + } } Kirigami.PlaceholderMessage { -- cgit v1.2.3-70-g09d2