From a01f8091c01889d7ca90938f56ae176a74da5590 Mon Sep 17 00:00:00 2001 From: Miquel Lionel Date: Wed, 29 Dec 2021 02:32:40 +0100 Subject: Implement notifications + "mute/unmute chat" menu - Added icons: Pinned and muted chats have icons. It's from Twemoji font, I've added credits in the README.md and source code of ChatlistItem.qml. I prefer to rely on .PNG for this one because icon might not be installed or exist on the system, and we avoid the black box problem. - Modified CMakeLists: added KNotifications as a required library - Modified build.sh: I cannot comprehend how the install(FILES) function from cmake works, so I used good old install from GNU coreutils. It copies usr/ structure and needed files (.desktop and .notifyrc) for KNotifications to work. - Aesthetic changes: context menu is shorter now due to the text being state-aware. You can now also mute a chat so you won't be notified on incoming messages. --- qml/ChatlistPage.qml | 3 +++ 1 file changed, 3 insertions(+) (limited to 'qml/ChatlistPage.qml') diff --git a/qml/ChatlistPage.qml b/qml/ChatlistPage.qml index d7e66ae..713113a 100644 --- a/qml/ChatlistPage.qml +++ b/qml/ChatlistPage.qml @@ -63,6 +63,7 @@ Kirigami.ScrollablePage { "avatarSource": profileImage ? "file:" + profileImage : "", "chatName": chat.name, "freshMsgCnt": chatlistPage.context.getFreshMsgCnt(chatId), + "isMuted" : chat.muted, "isContactRequest": chat.isContactRequest, "visibility": chat.visibility }; @@ -149,6 +150,8 @@ Kirigami.ScrollablePage { username: model.username freshMsgCnt: model.freshMsgCnt isContactRequest: model.isContactRequest + isMuted: model.isMuted + visibility: model.visibility isPinned: model.visibility == 2 width: chatlist.width onClicked: chatClicked(model.chatId) -- cgit v1.2.3-70-g09d2