summary refs log tree commit diff
path: root/resources/qml/emoji/EmojiButton.qml
diff options
context:
space:
mode:
authorJoseph Donofry <joedonofry@gmail.com>2020-05-13 00:35:26 -0400
committerJoseph Donofry <joedonofry@gmail.com>2020-05-13 00:36:41 -0400
commitee4dcef90f285f49ee27fec13afb486d93781b8b (patch)
treee6e4313098ef2c2fa4841fa7d6310825b08c0c4b /resources/qml/emoji/EmojiButton.qml
parentInitial support for sending reactions (diff)
downloadnheko-ee4dcef90f285f49ee27fec13afb486d93781b8b.tar.xz
Add new QML-based emoji picker (work in progress)
This is necessary to support having a picker within QML.
Eventually, this should replace the existing widget-based one.
Diffstat (limited to 'resources/qml/emoji/EmojiButton.qml')
-rw-r--r--resources/qml/emoji/EmojiButton.qml27
1 files changed, 27 insertions, 0 deletions
diff --git a/resources/qml/emoji/EmojiButton.qml b/resources/qml/emoji/EmojiButton.qml
new file mode 100644
index 00000000..51d5628c
--- /dev/null
+++ b/resources/qml/emoji/EmojiButton.qml
@@ -0,0 +1,27 @@
+import QtQuick 2.10
+import QtQuick.Controls 2.1
+import im.nheko 1.0
+import im.nheko.EmojiModel 1.0
+
+import "../"
+
+ImageButton {
+    property var colors: currentActivePalette
+
+    image: ":/icons/icons/ui/smile.png"
+    id: emojiButton
+    onClicked: emojiPopup.open()
+
+    EmojiPicker {
+        id: emojiPopup
+        x: Math.round((emojiButton.width - width) / 2)
+        y: emojiButton.height
+        width: 7 * 52
+        height: 6 * 52 
+        colors: emojiButton.colors
+        model: EmojiProxyModel {
+            category: Emoji.Category.People
+            sourceModel: EmojiModel {}
+        }
+    }
+}
\ No newline at end of file