feat(Chat): allow viewing unfurled images via popup

Fixes #668
This commit is contained in:
Pascal Precht 2020-09-30 16:01:08 +02:00 committed by Iuri Matias
parent 6d5bd52d0a
commit edfd952166
3 changed files with 18 additions and 1 deletions

View File

@ -6,6 +6,7 @@ Item {
property int verticalPadding: 0
property int imageWidth: 350
property url source
signal clicked(string source)
id: imageContainer
width: loadingImage.visible ? loadingImage.width : imageMessage.width
@ -47,5 +48,13 @@ Item {
scrollToBottom(true, messageItem)
}
}
MouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: {
imageContainer.clicked(imageContainer.source)
}
}
}
}

View File

@ -4,6 +4,7 @@ import "../../../../../imports"
Rectangle {
property int chatVerticalPadding: 12
property int chatHorizontalPadding: 12
signal clicked(string source)
id: imageChatBox
height: {
@ -43,6 +44,9 @@ Rectangle {
anchors.topMargin: verticalPadding
anchors.horizontalCenter: parent.horizontalCenter
source: modelData
onClicked: {
imageChatBox.clicked(source)
}
}
}

View File

@ -197,7 +197,11 @@ Item {
Component {
id: imageComponent
ImageMessage {}
ImageMessage {
onClicked: {
chatTextItem.clickMessage(false, false, true, source)
}
}
}
Loader {