mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 14:16:16 -04:00
Use emoji picker on chat view
This commit is contained in:
parent
48a77c5e1a
commit
e1498603be
1 changed files with 45 additions and 2 deletions
|
@ -22,6 +22,7 @@ import QtQuick.Layouts 1.2
|
||||||
import org.retroshare.qml_components.LibresapiLocalClient 1.0
|
import org.retroshare.qml_components.LibresapiLocalClient 1.0
|
||||||
import "." //Needed for TokensManager singleton
|
import "." //Needed for TokensManager singleton
|
||||||
import "./components"
|
import "./components"
|
||||||
|
import "./components/emoji"
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
|
@ -104,10 +105,39 @@ Item
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EmojiPicker {
|
||||||
|
id: emojiPicker
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.topMargin: parent.height / 2
|
||||||
|
anchors.bottomMargin: categorySelectorHeight
|
||||||
|
|
||||||
|
property int categorySelectorHeight: 40
|
||||||
|
|
||||||
|
color: "white"
|
||||||
|
buttonWidth: 40
|
||||||
|
textArea: inferiorPanel.textMessageArea //the TextArea in which EmojiPicker is pasting the Emoji into
|
||||||
|
|
||||||
|
state: "EMOJI_HIDDEN"
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "EMOJI_HIDDEN"
|
||||||
|
PropertyChanges { target: emojiPicker; anchors.topMargin: parent.height }
|
||||||
|
PropertyChanges { target: emojiPicker; anchors.bottomMargin: -1 }
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "EMOJI_SHOWN"
|
||||||
|
PropertyChanges { target: emojiPicker; anchors.topMargin: parent.height / 2 }
|
||||||
|
PropertyChanges { target: emojiPicker; anchors.bottomMargin: categorySelectorHeight }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
Item
|
Item
|
||||||
{
|
{
|
||||||
|
|
||||||
property var styles: StyleChat.inferiorPanel
|
property var styles: StyleChat.inferiorPanel
|
||||||
|
property alias textMessageArea: msgComposer.textMessageArea
|
||||||
|
|
||||||
id: inferiorPanel
|
id: inferiorPanel
|
||||||
height: ( msgComposer.height > styles.height)? msgComposer.height: styles.height
|
height: ( msgComposer.height > styles.height)? msgComposer.height: styles.height
|
||||||
|
@ -147,6 +177,7 @@ Item
|
||||||
{
|
{
|
||||||
id: msgComposer
|
id: msgComposer
|
||||||
property var styles: StyleChat.inferiorPanel.msgComposer
|
property var styles: StyleChat.inferiorPanel.msgComposer
|
||||||
|
property alias textMessageArea: flickable.msgField
|
||||||
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.left: attachButton.right
|
anchors.left: attachButton.right
|
||||||
|
@ -161,6 +192,8 @@ Item
|
||||||
Flickable
|
Flickable
|
||||||
{
|
{
|
||||||
id: flickable
|
id: flickable
|
||||||
|
property alias msgField: msgField
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
flickableDirection: Flickable.VerticalFlick
|
flickableDirection: Flickable.VerticalFlick
|
||||||
|
|
||||||
|
@ -190,6 +223,9 @@ Item
|
||||||
|
|
||||||
focus: true
|
focus: true
|
||||||
|
|
||||||
|
inputMethodHints: Qt.ImhMultiLine
|
||||||
|
textFormat: TextEdit.RichText
|
||||||
|
|
||||||
onTextChanged:
|
onTextChanged:
|
||||||
{
|
{
|
||||||
if (msgField.length == 0)
|
if (msgField.length == 0)
|
||||||
|
@ -230,8 +266,6 @@ Item
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BtnIcon
|
BtnIcon
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -248,6 +282,15 @@ Item
|
||||||
anchors.margins: styles.margin
|
anchors.margins: styles.margin
|
||||||
|
|
||||||
imgUrl: styles.emojiIconUrl
|
imgUrl: styles.emojiIconUrl
|
||||||
|
|
||||||
|
onClicked: {
|
||||||
|
if (emojiPicker.state == "EMOJI_HIDDEN") {
|
||||||
|
emojiPicker.state = "EMOJI_SHOWN"
|
||||||
|
} else {
|
||||||
|
emojiPicker.state = "EMOJI_HIDDEN"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BtnIcon
|
BtnIcon
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue