From 51084748ee4db5f7faab996147a85132cbb80031 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Thu, 25 May 2023 21:50:54 +0200 Subject: Make default completer complete custom emoji --- resources/qml/Completer.qml | 52 +++++++++++++++--------------------------- resources/qml/MessageInput.qml | 2 -- 2 files changed, 19 insertions(+), 35 deletions(-) (limited to 'resources/qml') 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 } diff --git a/resources/qml/MessageInput.qml b/resources/qml/MessageInput.qml index b810b9f0..8e72f458 100644 --- a/resources/qml/MessageInput.qml +++ b/resources/qml/MessageInput.qml @@ -169,8 +169,6 @@ Rectangle { messageInput.openCompleter(selectionStart-1, "emoji"); } else if (lastChar == '#') { messageInput.openCompleter(selectionStart-1, "roomAliases"); - } else if (lastChar == "~") { - messageInput.openCompleter(selectionStart-1, "customEmoji"); } else if (lastChar == "/" && cursorPosition == 1) { messageInput.openCompleter(selectionStart-1, "command"); } -- cgit 1.4.1