diff --git a/src/app/chat/views/channels_list.nim b/src/app/chat/views/channels_list.nim index b347630354..524bb39cb1 100644 --- a/src/app/chat/views/channels_list.nim +++ b/src/app/chat/views/channels_list.nim @@ -29,8 +29,6 @@ type LastMessage = UserRole + 2 Timestamp = UserRole + 3 UnreadMessages = UserRole + 4 - Identicon = UserRole + 5 - ChatType = UserRole + 6 QtObject: type @@ -62,18 +60,13 @@ QtObject: of ChannelsRoles.Timestamp: result = newQVariant($chatItem.timestamp) of ChannelsRoles.LastMessage: result = newQVariant(chatItem.lastMessage) of ChannelsRoles.UnreadMessages: result = newQVariant(chatItem.unviewedMessagesCount) - of ChannelsRoles.Identicon: result = newQVariant(chatItem.identicon) - of ChannelsRoles.ChatType: result = newQVariant(chatItem.chatType.int) method roleNames(self: ChannelsList): Table[int, string] = - { + { ChannelsRoles.Name.int:"name", ChannelsRoles.Timestamp.int:"timestamp", ChannelsRoles.LastMessage.int: "lastMessage", - ChannelsRoles.UnreadMessages.int: "unviewedMessagesCount", - ChannelsRoles.Identicon.int: "identicon", - ChannelsRoles.ChatType.int: "chatType" - + ChannelsRoles.UnreadMessages.int: "unviewedMessagesCount" }.toTable proc addChatItemToList*(self: ChannelsList, channel: ChatItem): int = diff --git a/src/models/chat/chat_item.nim b/src/models/chat/chat_item.nim index 5f7795d7f6..c41d2af785 100644 --- a/src/models/chat/chat_item.nim +++ b/src/models/chat/chat_item.nim @@ -8,14 +8,12 @@ type ChatItem* = ref object timestamp*: int64 unviewedMessagesCount*: int color*: string - identicon*: string proc newChatItem*(): ChatItem = new(result) result.name = "" result.lastMessage = "" result.timestamp = 0 - result.identicon = "" result.unviewedMessagesCount = 0 result.color = "" @@ -41,6 +39,5 @@ proc toChatItem*(chat: Chat): ChatItem = chatType: chat.chatType, lastMessage: chat.lastMessage.text, timestamp: chat.timestamp, - identicon: chat.lastMessage.identicon, unviewedMessagesCount: chat.unviewedMessagesCount ) diff --git a/ui/app/AppLayouts/Chat/ChatColumn.qml b/ui/app/AppLayouts/Chat/ChatColumn.qml index 3fa4f6bcb9..a50ad9321c 100644 --- a/ui/app/AppLayouts/Chat/ChatColumn.qml +++ b/ui/app/AppLayouts/Chat/ChatColumn.qml @@ -40,6 +40,9 @@ StackLayout { anchors.top: parent.top anchors.topMargin: Theme.smallPadding color: { + if (!chatsModel.activeChannel) { + return Theme.transparent + } const color = chatsModel.getChannelColor(chatsModel.activeChannel) if (!color) { return Theme.transparent diff --git a/ui/app/AppLayouts/Chat/ContactsColumn.qml b/ui/app/AppLayouts/Chat/ContactsColumn.qml index 095078a78c..6c3be88f1f 100644 --- a/ui/app/AppLayouts/Chat/ContactsColumn.qml +++ b/ui/app/AppLayouts/Chat/ContactsColumn.qml @@ -418,114 +418,6 @@ Item { anchors.rightMargin: Theme.padding color: Theme.blue visible: unviewedMessagesCount > 0 - anchors.top: applicationWindow.top - anchors.topMargin: 0 - anchors.left: parent.left - anchors.leftMargin: Theme.padding - radius: 8 - // Hide the box if it is filtered out - property bool isVisible: searchStr == "" || name.includes(searchStr) - visible: isVisible ? true : false - height: isVisible ? 64 : 0 - - MouseArea { - cursorShape: Qt.PointingHandCursor; - anchors.fill: parent - onClicked: { - chatsModel.setActiveChannelByIndex(index) - chatGroupsListView.currentIndex = index - } - } - - Rectangle { - id: contactImage - width: 40 - height: 40 - anchors.left: parent.left - anchors.leftMargin: Theme.padding - anchors.top: parent.top - anchors.topMargin: 12 - anchors.bottom: parent.bottom - anchors.bottomMargin: 12 - radius: 50 - - Loader { - sourceComponent: chatType == 1 ? imageIdenticon : letterIdenticon - anchors.fill: parent - } - - Component { - id: letterIdenticon - Rectangle { - width: 40 - height: 40 - radius: 50 - color: { - const color = chatsModel.getChannelColor(name) - if (!color) { - return Theme.transparent - } - return color - } - - Text { - text: (name.charAt(0) == "#" ? name.charAt(1) : name.charAt(0)).toUpperCase() - opacity: 0.7 - font.weight: Font.Bold - font.pixelSize: 21 - color: "white" - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - } - } - } - } - - Component { - id: imageIdenticon - Rectangle { - width: 40 - height: 40 - radius: 50 - border.color: "#10000000" - border.width: 1 - color: Theme.transparent - Image { - width: 40 - height: 40 - fillMode: Image.PreserveAspectFit - source: identicon - } - } - } - - Text { - id: contactInfo - text: chatType == 1 ? name : "#" + name - anchors.right: contactTime.left - anchors.rightMargin: Theme.smallPadding - elide: Text.ElideRight - font.weight: Font.Medium - font.pixelSize: 15 - anchors.left: contactImage.right - anchors.leftMargin: Theme.padding - anchors.top: parent.top - anchors.topMargin: Theme.smallPadding - color: "black" - } - Text { - id: lastChatMessage - text: lastMessage || qsTr("No messages") - anchors.right: contactNumberChatsCircle.left - anchors.rightMargin: Theme.smallPadding - elide: Text.ElideRight - anchors.bottom: parent.bottom - anchors.bottomMargin: Theme.smallPadding - font.pixelSize: 15 - anchors.left: contactImage.right - anchors.leftMargin: Theme.padding - color: Theme.darkGrey - } Text { id: contactNumberChats text: unviewedMessagesCount