Add Quick Reaction to EmojiDialog

This commit is contained in:
Gary Wang
2022-12-03 20:26:56 +08:00
parent bfa08d178f
commit 507bd44bbf
4 changed files with 36 additions and 1 deletions

View File

@@ -13,7 +13,7 @@ QQC2.ItemDelegate {
property bool showTones: false
QQC2.ToolTip.text: emojiDelegate.name
QQC2.ToolTip.visible: hovered
QQC2.ToolTip.visible: hovered && emojiDelegate.name !== ""
QQC2.ToolTip.delay: Kirigami.Units.toolTipDelay
leftInset: Kirigami.Units.smallSpacing
topInset: Kirigami.Units.smallSpacing

View File

@@ -11,6 +11,7 @@ ColumnLayout {
id: root
property bool includeCustom: false
property bool showQuickReaction: false
readonly property var currentEmojiModel: {
if (includeCustom) {
@@ -90,4 +91,35 @@ ColumnLayout {
header: categories
Keys.forwardTo: searchField
}
Kirigami.Separator {
visible: showQuickReaction
Layout.fillWidth: true
Layout.preferredHeight: 1
}
QQC2.ScrollView {
visible: showQuickReaction
Layout.fillWidth: true
Layout.preferredHeight: root.categoryIconSize + QQC2.ScrollBar.horizontal.height
QQC2.ScrollBar.horizontal.height: QQC2.ScrollBar.horizontal.visible ? QQC2.ScrollBar.horizontal.implicitHeight : 0
ListView {
id: quickReactions
Layout.fillWidth: true
model: ["👍", "👎", "😄", "🎉", "😕", "❤", "🚀", "👀"]
delegate: EmojiDelegate {
emoji: modelData
height: root.categoryIconSize
width: height
onClicked: root.chosen(modelData)
}
orientation: Qt.Horizontal
}
}
}