Use EmojiDialog popup in chatbar
This converts the emoji dialog in the chatbar to be the same popup as for reactions. This includes: - EmojiPicker and ReactionPicker were already similar and are made identical, as such ReactionPicker no longer needed - Emoji dialog used for both reactions and chatbar emojis - Add some parameters to allow for different use cases (include custom emojis and whether selection closes the popup) 
This commit is contained in:
@@ -10,7 +10,11 @@ import org.kde.neochat 1.0
|
||||
|
||||
QQC2.Popup {
|
||||
id: emojiPopup
|
||||
signal react(string emoji)
|
||||
|
||||
property bool includeCustom: false
|
||||
property bool closeOnChosen: true
|
||||
|
||||
signal chosen(string emoji)
|
||||
|
||||
Connections {
|
||||
target: RoomManager
|
||||
@@ -37,10 +41,12 @@ QQC2.Popup {
|
||||
|
||||
implicitHeight: Kirigami.Units.gridUnit * 20 + 2 * padding
|
||||
width: Math.min(contentItem.categoryIconSize * contentItem.categoryCount + 2 * padding, QQC2.Overlay.overlay.width)
|
||||
contentItem: ReactionPicker {
|
||||
contentItem: EmojiPicker {
|
||||
height: 400
|
||||
includeCustom: emojiPopup.includeCustom
|
||||
onChosen: {
|
||||
react(emoji)
|
||||
emojiPopup.close()
|
||||
emojiPopup.chosen(emoji)
|
||||
if (emojiPopup.closeOnChosen) emojiPopup.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user