feat: disable reply on stickers and make sticker images smooth
This commit is contained in:
parent
ce8cd4183f
commit
1d0e4fe2cf
|
@ -56,12 +56,13 @@ Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function clickMessage(isProfileClick) {
|
function clickMessage(isProfileClick, isSticker = false) {
|
||||||
if (!isProfileClick) {
|
if (!isProfileClick) {
|
||||||
SelectedMessage.set(messageId, fromAuthor);
|
SelectedMessage.set(messageId, fromAuthor);
|
||||||
}
|
}
|
||||||
profileClick(userName, fromAuthor, identicon);
|
profileClick(userName, fromAuthor, identicon);
|
||||||
messageContextMenu.isProfile = !!isProfileClick
|
messageContextMenu.isProfile = !!isProfileClick
|
||||||
|
messageContextMenu.isSticker = isSticker
|
||||||
messageContextMenu.popup()
|
messageContextMenu.popup()
|
||||||
// Position the center of the menu where the mouse is
|
// Position the center of the menu where the mouse is
|
||||||
messageContextMenu.x = messageContextMenu.x - messageContextMenu.width / 2
|
messageContextMenu.x = messageContextMenu.x - messageContextMenu.width / 2
|
||||||
|
|
|
@ -8,7 +8,7 @@ MouseArea {
|
||||||
z: 50
|
z: 50
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if(mouse.button & Qt.RightButton) {
|
if(mouse.button & Qt.RightButton) {
|
||||||
clickMessage()
|
clickMessage(false, isSticker)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,5 +6,7 @@ Image {
|
||||||
visible: contentType === Constants.stickerType
|
visible: contentType === Constants.stickerType
|
||||||
width: 140
|
width: 140
|
||||||
height: this.visible ? 140 : 0
|
height: this.visible ? 140 : 0
|
||||||
|
sourceSize.width: width
|
||||||
|
sourceSize.height: height
|
||||||
source: this.visible ? ("https://ipfs.infura.io/ipfs/" + sticker) : ""
|
source: this.visible ? ("https://ipfs.infura.io/ipfs/" + sticker) : ""
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,6 +8,7 @@ import "./"
|
||||||
|
|
||||||
PopupMenu {
|
PopupMenu {
|
||||||
property bool isProfile: false
|
property bool isProfile: false
|
||||||
|
property bool isSticker: false
|
||||||
|
|
||||||
id: messageContextMenu
|
id: messageContextMenu
|
||||||
width: messageContextMenu.isProfile ? profileHeader.width : emojiContainer.width
|
width: messageContextMenu.isProfile ? profileHeader.width : emojiContainer.width
|
||||||
|
@ -109,5 +110,6 @@ PopupMenu {
|
||||||
icon.source: "../../../img/messageActive.svg"
|
icon.source: "../../../img/messageActive.svg"
|
||||||
icon.width: 16
|
icon.width: 16
|
||||||
icon.height: 16
|
icon.height: 16
|
||||||
|
enabled: !isSticker
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,6 +25,8 @@ GridView {
|
||||||
Image {
|
Image {
|
||||||
width: 80
|
width: 80
|
||||||
height: 80
|
height: 80
|
||||||
|
sourceSize.width: width
|
||||||
|
sourceSize.height: height
|
||||||
fillMode: Image.PreserveAspectFit
|
fillMode: Image.PreserveAspectFit
|
||||||
source: "https://ipfs.infura.io/ipfs/" + url
|
source: "https://ipfs.infura.io/ipfs/" + url
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
|
|
@ -28,7 +28,8 @@ Rectangle {
|
||||||
smooth: false
|
smooth: false
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: "https://ipfs.infura.io/ipfs/" + thumbnail
|
source: "https://ipfs.infura.io/ipfs/" + thumbnail
|
||||||
|
sourceSize.width: width
|
||||||
|
sourceSize.height: height
|
||||||
MouseArea {
|
MouseArea {
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
Loading…
Reference in New Issue