Add emoji picker for reaction

This commit is contained in:
Carl Schwan
2020-11-24 14:25:48 +01:00
parent 092f8ee75d
commit fe63b0c9a7
6 changed files with 43 additions and 4 deletions

View File

@@ -46,6 +46,7 @@ ToolBar {
textArea: inputField
emojiModel: EmojiModel { id: emojiModel }
onChoosen: textArea.insert(textArea.cursorPosition, emoji)
}
RowLayout {

View File

@@ -17,6 +17,8 @@ ColumnLayout {
property var textArea
property var emojiModel
signal choosen(string emoji)
spacing: 0
ListView {
@@ -122,7 +124,7 @@ ColumnLayout {
}
onClicked: {
textArea.insert(textArea.cursorPosition, modelData.unicode)
choosen(modelData.unicode)
emojiModel.emojiUsed(modelData)
}
}

View File

@@ -120,11 +120,15 @@ RowLayout {
anchors.right: controlContainer.right
spacing: 0
QQC2.Button {
QQC2.ToolTip.text: i18n("React") + " (not implemented yet)"
QQC2.ToolTip.text: i18n("React")
QQC2.ToolTip.visible: hovered
visible: controlContainer.hovered
icon.name: "preferences-desktop-emoticons"
// TODO onClicked
onClicked: emojiDialog.open();
EmojiDialog {
id: emojiDialog
onReact: currentRoom.toggleReaction(eventId, emoji)
}
}
QQC2.Button {
QQC2.ToolTip.text: i18n("Reply")