aboutsummaryrefslogtreecommitdiff
path: root/qml/ChatlistPage.qml
diff options
context:
space:
mode:
authorlink2xt <link2xt@testrun.org>2021-02-22 02:55:46 +0300
committerlink2xt <link2xt@testrun.org>2021-02-22 02:55:46 +0300
commit6500863964b506235938974b843cfe20fa34929d (patch)
tree9cbe7ea2a3258c13fa44cc4ad54689aba1107637 /qml/ChatlistPage.qml
parent14d8dea44d81b365477263aa0087e3a7c633ae15 (diff)
downloadkdeltachat-6500863964b506235938974b843cfe20fa34929d.tar.gz
kdeltachat-6500863964b506235938974b843cfe20fa34929d.zip
ChatlistPage: display chat avatars
Diffstat (limited to 'qml/ChatlistPage.qml')
-rw-r--r--qml/ChatlistPage.qml14
1 files changed, 12 insertions, 2 deletions
diff --git a/qml/ChatlistPage.qml b/qml/ChatlistPage.qml
index a6efee1..911ab48 100644
--- a/qml/ChatlistPage.qml
+++ b/qml/ChatlistPage.qml
@@ -2,7 +2,7 @@ import QtQuick 2.12
import QtQuick.Controls 2.12
import QtQuick.Layouts 1.12
import QtQml.Models 2.1
-import org.kde.kirigami 2.12 as Kirigami
+import org.kde.kirigami 2.13 as Kirigami
import DeltaChat 1.0
@@ -37,11 +37,15 @@ Kirigami.Page {
for (let i = 0; i < chatlist.getChatCount(); i++) {
const summary = chatlist.getSummary(i)
const chatId = chatlist.getChatId(i)
+ const chat = chatlistPage.context.getChat(chatId)
+ const profileImage = chat.getProfileImage()
const item = {
chatId: chatId,
msgId: chatlist.getMsgId(i),
- username: (summary.text1 != "" ? summary.text1 + ": " : "") + summary.text2
+ username: (summary.text1 != "" ? summary.text1 + ": " : "") + summary.text2,
+ avatarSource: profileImage ? "file:" + profileImage : "",
+ chatName: chat.name
}
let j;
@@ -100,6 +104,12 @@ Kirigami.Page {
label: chatlistPage.context.getChat(model.chatId).getName()
subtitle: model.username
+
+ leading: Kirigami.Avatar {
+ source: model.avatarSource
+ name: model.chatName
+ implicitWidth: height
+ }
}
ScrollBar.vertical: ScrollBar {}