diff --git a/resources/qml/TimelineView.qml b/resources/qml/TimelineView.qml
index d9302ed7..3618140a 100644
--- a/resources/qml/TimelineView.qml
+++ b/resources/qml/TimelineView.qml
@@ -21,6 +21,7 @@ Page {
property real highlightHue: colors.highlight.hslHue
property real highlightSat: colors.highlight.hslSaturation
property real highlightLight: colors.highlight.hslLightness
+ property variant userProfile
palette: colors
@@ -238,6 +239,11 @@ Page {
}
}
+ Component{
+ id: userProfileComponent
+ UserProfile{}
+ }
+
section {
property: "section"
}
@@ -274,8 +280,6 @@ Page {
}
}
- property variant userProfile
-
Row {
height: userName.height
spacing: 8
@@ -290,9 +294,7 @@ Page {
MouseArea {
anchors.fill: parent
onClicked: {
- if(userProfile) userProfile.destroy()
- var component = Qt.createComponent("UserProfile.qml");
- userProfile = component.createObject(timelineRoot,{user_data : modelData});
+ userProfile = userProfileComponent.createObject(timelineRoot,{user_data: modelData,avatarUrl:chat.model.avatarUrl(modelData.userId)});
userProfile.show();
}
cursorShape: Qt.PointingHandCursor
@@ -310,10 +312,8 @@ Page {
anchors.fill: parent
Layout.alignment: Qt.AlignHCenter
onClicked: {
- if(userProfile) userProfile.destroy()
- var component = Qt.createComponent("UserProfile.qml")
- userProfile = component.createObject(timelineRoot,{user_data : modelData})
- userProfile.show()
+ userProfile = userProfileComponent.createObject(timelineRoot,{user_data: modelData,avatarUrl:chat.model.avatarUrl(modelData.userId)});
+ userProfile.show();
}
cursorShape: Qt.PointingHandCursor
propagateComposedEvents: true
diff --git a/resources/qml/UserProfile.qml b/resources/qml/UserProfile.qml
index 6ef75031..a0b0f993 100644
--- a/resources/qml/UserProfile.qml
+++ b/resources/qml/UserProfile.qml
@@ -9,6 +9,7 @@ import "./device-verification"
ApplicationWindow{
property var user_data
+ property var avatarUrl
property var colors: currentActivePalette
id:userProfileDialog
@@ -52,11 +53,11 @@ ApplicationWindow{
Avatar{
id: userProfileAvatar
- url:chat.model.avatarUrl(user_data.userId).replace("mxc://", "image://MxcImage/")
+ url: avatarUrl.replace("mxc://", "image://MxcImage/")
height: 130
width: 130
- displayName: modelData.userName
- userid: modelData.userId
+ displayName: user_data.userName
+ userid: user_data.userId
Layout.alignment: Qt.AlignHCenter
Layout.margins : {
top: 10
@@ -68,7 +69,7 @@ ApplicationWindow{
text: user_data.userName
fontSizeMode: Text.HorizontalFit
font.pixelSize: 20
- color:TimelineManager.userColor(modelData.userId, colors.window)
+ color:TimelineManager.userColor(user_data.userId, colors.window)
font.bold: true
Layout.alignment: Qt.AlignHCenter
}
@@ -207,7 +208,7 @@ ApplicationWindow{
Layout.margins : {
right : 10
- bottom : 10
+ bottom: 5
}
palette {
|