refactor(@desktop/general): qml updated according to the new `userProfile` instance
This commit is contained in:
parent
81e122cb0c
commit
9e567b8fdc
|
@ -198,7 +198,7 @@ StatusAppThreePanelLayout {
|
||||||
userList: chatColumn.userList
|
userList: chatColumn.userList
|
||||||
messageContextMenu: quickActionMessageOptionsMenu
|
messageContextMenu: quickActionMessageOptionsMenu
|
||||||
profilePubKey: userProfile.pubKey
|
profilePubKey: userProfile.pubKey
|
||||||
contactsList: root.rootStore.allContacts
|
contactsList: root.rootStore.profileModelInst.contacts.list
|
||||||
isOnline: root.rootStore.chatsModelInst.isOnline
|
isOnline: root.rootStore.chatsModelInst.isOnline
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@ ModalPopup {
|
||||||
name: userProfile.username + " " + qsTrId("(you)"),
|
name: userProfile.username + " " + qsTrId("(you)"),
|
||||||
pubKey: userProfile.pubKey,
|
pubKey: userProfile.pubKey,
|
||||||
address: "",
|
address: "",
|
||||||
identicon: "",
|
identicon: userProfile.identicon,
|
||||||
thumbnailImage: userProfile.thumbnailImage,
|
thumbnailImage: userProfile.thumbnailImage,
|
||||||
isUser: true
|
isUser: true
|
||||||
});
|
});
|
||||||
|
|
|
@ -356,8 +356,9 @@ Item {
|
||||||
badge.implicitHeight: 15
|
badge.implicitHeight: 15
|
||||||
badge.implicitWidth: 15
|
badge.implicitWidth: 15
|
||||||
badge.border.color: hovered ? Theme.palette.statusBadge.hoverBorderColor : Theme.palette.statusAppNavBar.backgroundColor
|
badge.border.color: hovered ? Theme.palette.statusBadge.hoverBorderColor : Theme.palette.statusAppNavBar.backgroundColor
|
||||||
|
badge.color: {
|
||||||
|
return userProfile.sendUserStatus ? Style.current.green : Style.current.midGrey
|
||||||
/*
|
/*
|
||||||
//This is still not in use. Read a comment for `currentUserStatus` in UserProfile on the nim side.
|
|
||||||
// Use this code once support for custom user status is added
|
// Use this code once support for custom user status is added
|
||||||
switch(userProfile.currentUserStatus){
|
switch(userProfile.currentUserStatus){
|
||||||
case Constants.statusType_Online:
|
case Constants.statusType_Online:
|
||||||
|
@ -367,7 +368,7 @@ Item {
|
||||||
default:
|
default:
|
||||||
return Style.current.midGrey;
|
return Style.current.midGrey;
|
||||||
}*/
|
}*/
|
||||||
badge.color: appMain.rootStore.userProfileInst.userStatus ? Style.current.green : Style.current.midGrey
|
}
|
||||||
badge.border.width: 3
|
badge.border.width: 3
|
||||||
onClicked: {
|
onClicked: {
|
||||||
userStatusContextMenu.opened ?
|
userStatusContextMenu.opened ?
|
||||||
|
|
|
@ -35,7 +35,7 @@ PopupMenu {
|
||||||
}
|
}
|
||||||
StyledText {
|
StyledText {
|
||||||
id: username
|
id: username
|
||||||
text: Utils.removeStatusEns(root.store.profileModelInst.ens.preferredUsername || root.store.userProfileInst.username)
|
text: Utils.removeStatusEns(profileModel.ens.preferredUsername || userProfile.username)
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
maximumLineCount: 3
|
maximumLineCount: 3
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
@ -71,7 +71,7 @@ PopupMenu {
|
||||||
hoverEnabled: true
|
hoverEnabled: true
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
openProfilePopup(root.store.userProfileInst.username, root.store.userProfileInst.pubKey, root.store.userProfileInst.thumbnailImage)
|
openProfilePopup(userProfile.username, userProfile.pubKey, userProfile.thumbnailImage);
|
||||||
root.close()
|
root.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -86,8 +86,8 @@ PopupMenu {
|
||||||
Action {
|
Action {
|
||||||
text: qsTr("Online")
|
text: qsTr("Online")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
if (!root.store.userProfileInst.sendUserStatus) {
|
if (userProfile.sendUserStatus != true) {
|
||||||
root.store.mainModuleInst.setUserStatus(true)
|
root.store.profileModelInst.profile.setSendUserStatus(true)
|
||||||
}
|
}
|
||||||
root.close();
|
root.close();
|
||||||
}
|
}
|
||||||
|
@ -100,8 +100,8 @@ PopupMenu {
|
||||||
Action {
|
Action {
|
||||||
text: qsTr("Offline")
|
text: qsTr("Offline")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
if (root.store.userProfileInst.userStatus) {
|
if (userProfile.sendUserStatus != false) {
|
||||||
root.store.mainModuleInst.setUserStatus(false)
|
root.store.profileModelInst.profile.setSendUserStatus(false)
|
||||||
}
|
}
|
||||||
root.close();
|
root.close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue