diff options
author | Jedi18 <targetakhil@gmail.com> | 2021-02-02 13:30:47 +0530 |
---|---|---|
committer | Jedi18 <targetakhil@gmail.com> | 2021-02-02 13:30:47 +0530 |
commit | d535cc5e759757fc71751df7d89131cdf2cd71d2 (patch) | |
tree | beb30cb76bc98e699bbd9349ca5e738035cc8fff /resources | |
parent | update room and global avatar through user profile (diff) | |
download | nheko-d535cc5e759757fc71751df7d89131cdf2cd71d2.tar.xz |
add error message and update avatars on avatar change in timeline and user profile dialog
Diffstat (limited to 'resources')
-rw-r--r-- | resources/qml/MessageView.qml | 8 | ||||
-rw-r--r-- | resources/qml/UserProfile.qml | 31 |
2 files changed, 39 insertions, 0 deletions
diff --git a/resources/qml/MessageView.qml b/resources/qml/MessageView.qml index dae3e5d7..29115b00 100644 --- a/resources/qml/MessageView.qml +++ b/resources/qml/MessageView.qml @@ -101,6 +101,7 @@ ListView { spacing: 8 Avatar { + id: messageUserAvatar width: avatarSize height: avatarSize url: modelData ? chat.model.avatarUrl(modelData.userId).replace("mxc://", "image://MxcImage/") : "" @@ -109,6 +110,13 @@ ListView { onClicked: chat.model.openUserProfile(modelData.userId) } + Connections { + target: chat.model + onRoomAvatarUrlChanged: { + messageUserAvatar.url = modelData ? chat.model.avatarUrl(modelData.userId).replace("mxc://", "image://MxcImage/") : "" + } + } + Label { id: userName diff --git a/resources/qml/UserProfile.qml b/resources/qml/UserProfile.qml index cff69a90..349fb89f 100644 --- a/resources/qml/UserProfile.qml +++ b/resources/qml/UserProfile.qml @@ -34,6 +34,37 @@ ApplicationWindow { onClicked: profile.isSelf ? profile.changeAvatar() : TimelineManager.openImageOverlay(TimelineManager.timeline.avatarUrl(userid), TimelineManager.timeline.data.id) } + Text { + id: errorText + text: "Error Text" + color: "red" + visible: opacity > 0 + opacity: 0 + Layout.alignment: Qt.AlignHCenter + } + + SequentialAnimation { + id: hideErrorAnimation + running: false + PauseAnimation { + duration: 4000 + } + NumberAnimation { + target: errorText + property: 'opacity' + to: 0 + duration: 1000 + } + } + + Connections{ + target: profile + onDisplayError: { + errorText.opacity = 1 + hideErrorAnimation.restart() + } + } + TextInput { id: displayUsername |