emizzle 847eb2623f feat: add sticker popup
Add sticker popup
Add send sticker message
Add ability to select sticker pack and show stickers for pack with scroll

1. Sticker history
2. Install sticker packs
3. Sticker market

1. Sticker packs are installed on app start up until installation of sticker pack functionality is added
2. Optimisations such as preloading images to be done so that sticker images are not downloaded each time.
2020-06-25 10:27:26 -04:00

74 lines
1.9 KiB
QML

import QtQuick 2.13
import QtQuick.Controls 2.13
import "../../../../imports"
import "../components"
Rectangle {
border.width: 0
Button {
id: chatSendBtn
visible: txtData.length > 0
width: 30
height: 30
text: ""
anchors.rightMargin: Theme.padding
anchors.verticalCenter: parent.verticalCenter
anchors.right: parent.right
onClicked: {
chatsModel.sendMessage(txtData.text)
txtData.text = ""
}
background: Rectangle {
color: parent.enabled ? Theme.blue : Theme.grey
radius: 50
}
Image {
source: "../../../img/arrowUp.svg"
width: 12
fillMode: Image.PreserveAspectFit
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
}
}
Image {
id: stickersIcon
visible: txtData.length == 0
width: 20
height: 20
anchors.rightMargin: Theme.padding
anchors.right: parent.right
fillMode: Image.PreserveAspectFit
source: "../../../img/stickers_icon" + (stickersPopup.opened ? "_open.svg" : ".svg")
anchors.verticalCenter: parent.verticalCenter
MouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked: {
if (stickersPopup.opened) {
stickersPopup.close()
} else {
stickersPopup.open()
}
}
}
}
StickersPopup {
id: stickersPopup
width: 360
height: 440
x: parent.width - width - 8
y: parent.height - sendBtns.height - height - 8
stickerList: chatsModel.stickers
stickerPackList: chatsModel.stickerPacks
}
}
/*##^##
Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/