summary refs log tree commit diff
path: root/resources/qml
diff options
context:
space:
mode:
Diffstat (limited to 'resources/qml')
-rw-r--r--resources/qml/MessageView.qml8
-rw-r--r--resources/qml/UserProfile.qml40
2 files changed, 47 insertions, 1 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 4a402b69..37ae6de8 100644 --- a/resources/qml/UserProfile.qml +++ b/resources/qml/UserProfile.qml
@@ -38,7 +38,45 @@ ApplicationWindow { displayName: profile.displayName userid: profile.userid Layout.alignment: Qt.AlignHCenter - onClicked: TimelineManager.openImageOverlay(TimelineManager.timeline.avatarUrl(userid), TimelineManager.timeline.data.id) + onClicked: profile.isSelf ? profile.changeAvatar() : TimelineManager.openImageOverlay(TimelineManager.timeline.avatarUrl(userid), TimelineManager.timeline.data.id) + } + + BusyIndicator { + Layout.alignment: Qt.AlignHCenter + running: profile.isLoading + visible: profile.isLoading + } + + 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.text = errorMessage + errorText.opacity = 1 + hideErrorAnimation.restart() + } } TextInput {