add error message and update avatars on avatar change in timeline and user profile dialog
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
|