fix(search): fix 1-1 name, pic, icon and symbol

This commit is contained in:
Jonathan Rainville 2021-07-12 14:36:03 -04:00 committed by Iuri Matias
parent 3169fe636b
commit 3e33db039f
6 changed files with 19 additions and 23 deletions

View File

@ -65,15 +65,13 @@ QtObject:
proc name*(self: ChatItemView): string {.slot.} =
if self.chatItem != nil and self.chatItem.chatType.isOneToOne:
if self.chatItem.name == self.chatItem.id:
result = self.userNameOrAlias(self.chatItem.id)
if self.status.chat.contacts.hasKey(self.chatItem.id) and self.status.chat.contacts[self.chatItem.id].hasNickname():
return self.status.chat.contacts[self.chatItem.id].localNickname
let username = self.userNameOrAlias(self.chatItem.id)
if username != "":
result = username.userName(true)
else:
if self.status.chat.contacts.hasKey(self.chatItem.id) and self.status.chat.contacts[self.chatItem.id].hasNickname():
return self.status.chat.contacts[self.chatItem.id].localNickname
if self.chatItem.ensName != "":
result = "@" & userName(self.chatItem.ensName).userName(true)
else:
result = self.chatItem.name
result = self.chatItem.name
else:
result = ?.self.chatItem.name

View File

@ -234,12 +234,7 @@ StackLayout {
property string chatId: chatsModel.channelView.activeChannel.id
property string profileImage: appMain.getProfileImage(chatId) || ""
chatInfoButton.title: {
if (chatsModel.channelView.activeChannel.chatType === Constants.chatTypeOneToOne) {
return Utils.removeStatusEns(chatsModel.userNameOrAlias(chatsModel.channelView.activeChannel.id))
}
return chatsModel.channelView.activeChannel.name
}
chatInfoButton.title: Utils.removeStatusEns(chatsModel.channelView.activeChannel.name)
chatInfoButton.subTitle: {
switch (chatsModel.channelView.activeChannel.chatType) {
case Constants.chatTypeOneToOne:

View File

@ -12,6 +12,7 @@ Item {
property string name: "channelName"
property string identicon
property string communityId
property bool hideSecondIcon: false
property int chatType: chatsModel.channelView.chats.getChannelType(chatId)
property int realChatType: {
if (chatType === Constants.chatTypeCommunity) {
@ -49,6 +50,7 @@ Item {
height: parent.height
SVGImage {
id: communityIcon
visible: !hideSecondIcon
width: 16
height: 16
source: "../../../img/communities.svg"
@ -65,7 +67,7 @@ Item {
Loader {
id: communityImageLoader
active: true
anchors.left: communityIcon.right
anchors.left: communityIcon.visible ? communityIcon.right : parent.left
anchors.leftMargin: 2
anchors.verticalCenter: parent.verticalCenter
sourceComponent: communityBadge.useLetterIdenticon ? letterIdenticon :imageIcon

View File

@ -60,8 +60,8 @@ Popup {
SVGImage {
id: searchImage
source: "../../../img/search.svg"
width: 28
height: 28
width: 40
height: 40
anchors.left: parent.left
anchors.leftMargin: Style.current.padding
anchors.verticalCenter: parent.verticalCenter
@ -128,13 +128,14 @@ Popup {
}
BadgeContent {
chatId: chatId
name: chatsModel.channelView.activeChannel.name
chatId: popup.chatId
name: Utils.removeStatusEns(chatsModel.channelView.activeChannel.name)
identicon: chatsModel.channelView.activeChannel.identicon
communityId: chatsModel.channelView.activeChannel.communityId
anchors.left: inText.right
anchors.leftMargin: 4
anchors.verticalCenter: parent.verticalCenter
hideSecondIcon: true
}
}

View File

@ -1,3 +1,3 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M5.92798 11.856C2.65405 11.856 0 9.2019 0 5.92798C0 2.65405 2.65405 0 5.92798 0C9.2019 0 11.856 2.65405 11.856 5.92798C11.856 7.20825 11.45 8.39368 10.76 9.36267L15.7087 14.3114C16.0945 14.6973 16.0945 15.3228 15.7087 15.7086C15.3228 16.0945 14.6973 16.0945 14.3115 15.7086L9.36279 10.76C8.3938 11.4501 7.20825 11.856 5.92798 11.856ZM5.92798 9.87988C8.1106 9.87988 9.88013 8.1106 9.88013 5.92798C9.88013 3.74536 8.1106 1.97595 5.92798 1.97595C3.74536 1.97595 1.97607 3.74536 1.97607 5.92798C1.97607 8.1106 3.74536 9.87988 5.92798 9.87988Z" fill="#939BA1"/>
<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M24.7507 26.5185C24.4514 26.2192 23.9772 26.1948 23.6283 26.4345C21.8855 27.6323 19.7746 28.3333 17.5 28.3333C11.5169 28.3333 6.66663 23.4831 6.66663 17.5C6.66663 11.5169 11.5169 6.66667 17.5 6.66667C23.483 6.66667 28.3333 11.5169 28.3333 17.5C28.3333 19.7746 27.6323 21.8855 26.4345 23.6284C26.1948 23.9772 26.2191 24.4514 26.5184 24.7507L34.2172 32.4497C34.7053 32.9378 34.7053 33.7293 34.2172 34.2174C33.729 34.7056 32.9375 34.7056 32.4494 34.2174L24.7507 26.5185ZM25.8333 17.5C25.8333 22.1024 22.1023 25.8333 17.5 25.8333C12.8976 25.8333 9.16663 22.1024 9.16663 17.5C9.16663 12.8976 12.8976 9.16667 17.5 9.16667C22.1023 9.16667 25.8333 12.8976 25.8333 17.5Z" fill="#939BA1"/>
</svg>

Before

Width:  |  Height:  |  Size: 709 B

After

Width:  |  Height:  |  Size: 832 B

View File

@ -6,8 +6,8 @@ Input {
//% "Search"
placeholderText: qsTrId("search")
icon: "../app/img/search.svg"
iconWidth: 17
iconHeight: 17
iconWidth: 24
iconHeight: 24
customHeight: 36
fontPixelSize: 15
}