fix: small fixes to the profile popup

This commit is contained in:
Jonathan Rainville 2020-09-17 10:26:26 -04:00 committed by Iuri Matias
parent 6e357cb5e2
commit 0c0baf29e8
5 changed files with 20 additions and 11 deletions

View File

@ -51,7 +51,7 @@ proc addContact*(self: ContactModel, id: string, localNickname: string): string
self.events.emit("contactAdded", Args())
proc addContact*(self: ContactModel, id: string): string =
result = self.addContact(id)
result = self.addContact(id, "")
proc removeContact*(self: ContactModel, id: string) =
let contact = self.getContactByID(id)

View File

@ -83,6 +83,7 @@ PopupMenu {
}
onClicked: {
profilePopup.open()
messageContextMenu.close()
}
}
}
@ -95,7 +96,10 @@ PopupMenu {
id: viewProfileAction
//% "View profile"
text: qsTrId("view-profile")
onTriggered: profilePopup.open()
onTriggered: {
profilePopup.open()
messageContextMenu.close()
}
icon.source: "../../../img/profileActive.svg"
icon.width: 16
icon.height: 16
@ -106,7 +110,10 @@ PopupMenu {
qsTrId("send-message") :
//% "Reply to"
qsTrId("reply-to")
onTriggered: messageContextMenu.isProfile ? chatsModel.joinChat(profilePopup.fromAuthor, Constants.chatTypeOneToOne) : showReplyArea()
onTriggered: {
messageContextMenu.isProfile ? chatsModel.joinChat(profilePopup.fromAuthor, Constants.chatTypeOneToOne) : showReplyArea()
messageContextMenu.close()
}
icon.source: "../../../img/messageActive.svg"
icon.width: 16
icon.height: 16

View File

@ -78,6 +78,7 @@ ModalPopup {
disabled: popup.nicknameLength === 0 || popup.nicknameTooLong
onClicked: {
userName = nicknameInput.textField.text
nickname = nicknameInput.textField.text
profileModel.changeContactNickname(fromAuthor, nicknameInput.textField.text)
popup.close()
}

View File

@ -8,12 +8,12 @@ import "./"
ModalPopup {
id: popup
property string identicon: ""
property string userName: ""
property string nickname: ""
property string fromAuthor: ""
property string text: ""
property string alias: ""
property var identicon: ""
property var userName: ""
property var nickname: ""
property var fromAuthor: ""
property var text: ""
property var alias: ""
property bool showQR: false
property bool isEnsVerified: false
@ -32,9 +32,9 @@ ModalPopup {
isEnsVerified = chatsModel.isEnsVerified(this.fromAuthor)
alias = chatsModel.alias(this.fromAuthor) || ""
}
function openPopup(userNameParam, fromAuthorParam, identiconParam, textParam, nicknameParam) {
setPopupData(userNameParam, fromAuthorParam, identiconParam, textParam, nicknameParam);
setPopupData(userNameParam, fromAuthorParam, identiconParam, textParam, nicknameParam)
popup.open()
}

View File

@ -152,6 +152,7 @@ DISTFILES += \
app/AppLayouts/Chat/components/EmojiCategoryButton.qml \
app/AppLayouts/Chat/components/EmojiPopup.qml \
app/AppLayouts/Chat/components/EmojiReaction.qml \
app/AppLayouts/Chat/components/ProfilePopup.qml \
app/AppLayouts/Chat/components/EmojiSection.qml \
app/AppLayouts/Chat/components/InviteFriendsPopup.qml \
app/AppLayouts/Chat/components/MessageContextMenu.qml \