2021-10-01 15:58:36 +00:00
|
|
|
import QtQuick 2.3
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
2021-10-01 15:58:36 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
Loader {
|
|
|
|
id: root
|
|
|
|
height: active ? item.height : 0
|
|
|
|
property int imageHeight: 36
|
|
|
|
property int imageWidth: 36
|
2021-12-09 12:53:40 +00:00
|
|
|
property string icon: ""
|
|
|
|
property bool isIdenticon: false
|
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
signal clickMessage(bool isProfileClick, bool isSticker, bool isImage, var image, bool emojiOnly, bool hideEmojiPicker, bool isReply)
|
|
|
|
|
|
|
|
sourceComponent: Component {
|
|
|
|
Item {
|
|
|
|
id: chatImage
|
|
|
|
width: identiconImage.width
|
|
|
|
height: identiconImage.height
|
|
|
|
|
|
|
|
RoundedImage {
|
|
|
|
id: identiconImage
|
|
|
|
width: root.imageWidth
|
|
|
|
height: root.imageHeight
|
2021-12-09 12:53:40 +00:00
|
|
|
border.width: root.isIdenticon ? 1 : 0
|
2021-10-01 15:58:36 +00:00
|
|
|
border.color: Style.current.border
|
2021-12-09 12:53:40 +00:00
|
|
|
source: root.icon
|
2021-10-01 15:58:36 +00:00
|
|
|
smooth: false
|
|
|
|
antialiasing: true
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: {
|
|
|
|
if (!!messageContextMenu) {
|
|
|
|
// Set parent, X & Y positions for the messageContextMenu
|
|
|
|
messageContextMenu.parent = root
|
|
|
|
messageContextMenu.setXPosition = function() { return root.width + 4}
|
|
|
|
messageContextMenu.setYPosition = function() { return root.height/2 + 4}
|
|
|
|
}
|
|
|
|
root.clickMessage(true, false, false, null, false, false, isReplyImage)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|