summary refs log tree commit diff
path: root/resources/qml/Completer.qml
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2023-05-25 21:50:54 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2023-05-25 21:53:23 +0200
commit51084748ee4db5f7faab996147a85132cbb80031 (patch)
tree4bb744783aeddc95979a0b567a872a7cd480b95d /resources/qml/Completer.qml
parentGet rid of old emoji picker (diff)
downloadnheko-51084748ee4db5f7faab996147a85132cbb80031.tar.xz
Make default completer complete custom emoji
Diffstat (limited to 'resources/qml/Completer.qml')
-rw-r--r--resources/qml/Completer.qml52
1 files changed, 19 insertions, 33 deletions
diff --git a/resources/qml/Completer.qml b/resources/qml/Completer.qml
index cc1047a0..0a9c41ed 100644
--- a/resources/qml/Completer.qml
+++ b/resources/qml/Completer.qml
@@ -21,7 +21,7 @@ Control {
     property int avatarHeight: 24
     property int avatarWidth: 24
     property int rowMargin: 0
-    property int rowSpacing: 5
+    property int rowSpacing: Nheko.paddingSmall
     property alias count: listView.count
 
     signal completionClicked(string completion)
@@ -199,37 +199,32 @@ Control {
                         spacing: rowSpacing
 
                         Label {
+                            visible: !!model.unicode
                             text: model.unicode
                             color: model.index == popup.currentIndex ? Nheko.colors.highlightedText : Nheko.colors.text
                             font: Settings.emojiFont
                         }
 
-                        Label {
-                            text: model.shortName
-                            color: model.index == popup.currentIndex ? Nheko.colors.highlightedText : Nheko.colors.text
+                        Avatar {
+                            visible: !model.unicode
+                            height: popup.avatarHeight
+                            width: popup.avatarWidth
+                            displayName: model.shortcode
+                            //userid: model.shortcode
+                            url: (model.url ? model.url : "").replace("mxc://", "image://MxcImage/")
+                            enabled: false
+                            crop: false
                         }
 
-                    }
-
-                }
-
-                DelegateChoice {
-                    roleValue: "command"
-
-                    RowLayout {
-                        id: del
-
-                        anchors.centerIn: parent
-                        spacing: rowSpacing
-
                         Label {
-                            text: model.name
+                            Layout.leftMargin: Nheko.paddingSmall
+                            Layout.rightMargin: Nheko.paddingSmall
+                            text: model.shortcode
                             color: model.index == popup.currentIndex ? Nheko.colors.highlightedText : Nheko.colors.text
-                            font.bold: true
                         }
 
                         Label {
-                            text: model.description
+                            text: "(" + model.packname + ")"
                             color: model.index == popup.currentIndex ? Nheko.colors.highlightedText : Nheko.colors.buttonText
                         }
 
@@ -238,7 +233,7 @@ Control {
                 }
 
                 DelegateChoice {
-                    roleValue: "customEmoji"
+                    roleValue: "command"
 
                     RowLayout {
                         id: del
@@ -246,23 +241,14 @@ Control {
                         anchors.centerIn: parent
                         spacing: rowSpacing
 
-                        Avatar {
-                            height: popup.avatarHeight
-                            width: popup.avatarWidth
-                            displayName: model.shortcode
-                            //userid: model.shortcode
-                            url: model.url.replace("mxc://", "image://MxcImage/")
-                            enabled: false
-                            crop: false
-                        }
-
                         Label {
-                            text: model.shortcode
+                            text: model.name
                             color: model.index == popup.currentIndex ? Nheko.colors.highlightedText : Nheko.colors.text
+                            font.bold: true
                         }
 
                         Label {
-                            text: "(" + model.packname + ")"
+                            text: model.description
                             color: model.index == popup.currentIndex ? Nheko.colors.highlightedText : Nheko.colors.buttonText
                         }