feat: disable reply on stickers and make sticker images smooth

This commit is contained in:
Richard Ramos 2020-08-27 19:26:12 -04:00 committed by Iuri Matias
parent ce8cd4183f
commit 1d0e4fe2cf
6 changed files with 11 additions and 3 deletions

View File

@ -56,12 +56,13 @@ Item {
}
}
function clickMessage(isProfileClick) {
function clickMessage(isProfileClick, isSticker = false) {
if (!isProfileClick) {
SelectedMessage.set(messageId, fromAuthor);
}
profileClick(userName, fromAuthor, identicon);
messageContextMenu.isProfile = !!isProfileClick
messageContextMenu.isSticker = isSticker
messageContextMenu.popup()
// Position the center of the menu where the mouse is
messageContextMenu.x = messageContextMenu.x - messageContextMenu.width / 2

View File

@ -8,7 +8,7 @@ MouseArea {
z: 50
onClicked: {
if(mouse.button & Qt.RightButton) {
clickMessage()
clickMessage(false, isSticker)
return;
}
}

View File

@ -6,5 +6,7 @@ Image {
visible: contentType === Constants.stickerType
width: 140
height: this.visible ? 140 : 0
sourceSize.width: width
sourceSize.height: height
source: this.visible ? ("https://ipfs.infura.io/ipfs/" + sticker) : ""
}

View File

@ -8,6 +8,7 @@ import "./"
PopupMenu {
property bool isProfile: false
property bool isSticker: false
id: messageContextMenu
width: messageContextMenu.isProfile ? profileHeader.width : emojiContainer.width
@ -109,5 +110,6 @@ PopupMenu {
icon.source: "../../../img/messageActive.svg"
icon.width: 16
icon.height: 16
enabled: !isSticker
}
}

View File

@ -25,6 +25,8 @@ GridView {
Image {
width: 80
height: 80
sourceSize.width: width
sourceSize.height: height
fillMode: Image.PreserveAspectFit
source: "https://ipfs.infura.io/ipfs/" + url
MouseArea {

View File

@ -28,7 +28,8 @@ Rectangle {
smooth: false
anchors.fill: parent
source: "https://ipfs.infura.io/ipfs/" + thumbnail
sourceSize.width: width
sourceSize.height: height
MouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent