2020-07-15 21:04:14 +00:00
|
|
|
import QtQuick 2.3
|
|
|
|
import "../../../../../shared"
|
|
|
|
import "../../../../../imports"
|
|
|
|
|
2020-09-30 20:40:54 +00:00
|
|
|
Loader {
|
2021-04-23 15:49:05 +00:00
|
|
|
property int imageHeight: 36
|
|
|
|
property int imageWidth: 36
|
|
|
|
property string identiconImageSource: identicon
|
|
|
|
property string profileImage: profileImageSource
|
|
|
|
property bool isReplyImage: false
|
|
|
|
|
|
|
|
id: root
|
2021-02-09 14:53:54 +00:00
|
|
|
active: isMessage
|
2020-09-30 20:40:54 +00:00
|
|
|
height: active ? item.height : 0
|
2020-07-15 21:04:14 +00:00
|
|
|
|
2020-09-30 20:40:54 +00:00
|
|
|
sourceComponent: Component {
|
2020-11-30 17:03:52 +00:00
|
|
|
Item {
|
2020-09-30 20:40:54 +00:00
|
|
|
id: chatImage
|
|
|
|
width: identiconImage.width
|
|
|
|
height: identiconImage.height
|
2020-07-15 21:04:14 +00:00
|
|
|
|
2020-11-30 17:03:52 +00:00
|
|
|
RoundedImage {
|
2020-09-30 20:40:54 +00:00
|
|
|
id: identiconImage
|
2021-04-23 15:49:05 +00:00
|
|
|
width: root.imageWidth
|
|
|
|
height: root.imageHeight
|
2020-11-30 17:03:52 +00:00
|
|
|
border.width: 1
|
|
|
|
border.color: Style.current.border
|
|
|
|
source: {
|
2021-04-23 15:49:05 +00:00
|
|
|
if (root.profileImage) {
|
|
|
|
return root.profileImage
|
2020-11-30 17:03:52 +00:00
|
|
|
}
|
2021-01-28 20:13:20 +00:00
|
|
|
identiconImage.showLoadingIndicator = false
|
2021-04-23 15:49:05 +00:00
|
|
|
return !isCurrentUser || isReplyImage ? root.identiconImageSource : profileModel.profile.identicon
|
2020-11-30 17:03:52 +00:00
|
|
|
}
|
2020-09-30 20:40:54 +00:00
|
|
|
smooth: false
|
|
|
|
antialiasing: true
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
|
|
|
clickMessage(true)
|
|
|
|
}
|
|
|
|
}
|
2020-07-15 21:04:14 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|