From ef80085fab6d83a89a9a4309f2e7cdd272a812fe Mon Sep 17 00:00:00 2001 From: link2xt Date: Sun, 1 Aug 2021 19:23:41 +0300 Subject: Add "pinned" badge for pinned chats --- qml/ChatlistPage.qml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'qml/ChatlistPage.qml') diff --git a/qml/ChatlistPage.qml b/qml/ChatlistPage.qml index a0d171a..03b18be 100644 --- a/qml/ChatlistPage.qml +++ b/qml/ChatlistPage.qml @@ -110,7 +110,8 @@ Kirigami.ScrollablePage { avatarSource: profileImage ? "file:" + profileImage : "", chatName: chat.name, freshMsgCnt: chatlistPage.context.getFreshMsgCnt(chatId), - isContactRequest: chat.isContactRequest + isContactRequest: chat.isContactRequest, + visibility: chat.visibility } let j; @@ -221,6 +222,7 @@ Kirigami.ScrollablePage { } } + Label { text: model.isContactRequest ? "NEW" : model.freshMsgCnt visible: model.freshMsgCnt > 0 || model.isContactRequest @@ -237,6 +239,20 @@ Kirigami.ScrollablePage { radius: 0.25 * height } } + + // "Pinned" badge + Rectangle { + visible: model.visibility == 2 + color: Kirigami.Theme.alternateBackgroundColor + width: Kirigami.Units.gridUnit + height: Kirigami.Units.gridUnit + radius: 0.25 * height + Kirigami.Icon { + source: "pin" + height: Kirigami.Units.gridUnit + width: Kirigami.Units.gridUnit + } + } } } } -- cgit v1.2.3-70-g09d2