2020-06-24 03:23:49 +00:00
|
|
|
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: ""
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.rightMargin: Style.current.padding
|
2020-06-24 03:23:49 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
anchors.right: parent.right
|
|
|
|
onClicked: {
|
|
|
|
chatsModel.sendMessage(txtData.text)
|
|
|
|
txtData.text = ""
|
|
|
|
}
|
|
|
|
background: Rectangle {
|
2020-07-02 15:14:31 +00:00
|
|
|
color: parent.enabled ? Style.current.blue : Style.current.grey
|
2020-06-24 03:23:49 +00:00
|
|
|
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
|
2020-07-02 15:14:31 +00:00
|
|
|
anchors.rightMargin: Style.current.padding
|
2020-06-24 03:23:49 +00:00
|
|
|
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: {
|
2020-07-02 17:48:06 +00:00
|
|
|
console.log('CLICK')
|
|
|
|
if (emojiPopup.opened) {
|
|
|
|
console.log('CLOSE')
|
|
|
|
emojiPopup.close()
|
2020-06-24 03:23:49 +00:00
|
|
|
} else {
|
2020-07-02 17:48:06 +00:00
|
|
|
console.log('OPEN')
|
|
|
|
emojiPopup.open()
|
2020-06-24 03:23:49 +00:00
|
|
|
}
|
2020-07-02 17:48:06 +00:00
|
|
|
// if (stickersPopup.opened) {
|
|
|
|
// stickersPopup.close()
|
|
|
|
// } else {
|
|
|
|
// stickersPopup.open()
|
|
|
|
// }
|
2020-06-24 03:23:49 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
|
}
|
2020-07-02 17:48:06 +00:00
|
|
|
|
|
|
|
EmojiPopup {
|
|
|
|
id: emojiPopup
|
|
|
|
width: 360
|
|
|
|
height: 440
|
|
|
|
x: parent.width - width - 8
|
|
|
|
y: parent.height - sendBtns.height - height - 8
|
|
|
|
}
|
2020-06-24 03:23:49 +00:00
|
|
|
}
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
|
|
|
D{i:0;autoSize:true;height:480;width:640}
|
|
|
|
}
|
|
|
|
##^##*/
|