Add an ugly custom emote completer using ~

This commit is contained in:
Nicolas Werner 2021-12-27 06:23:36 +01:00
parent 3e8734dbd5
commit ea6b19b307
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
5 changed files with 64 additions and 22 deletions

View file

@ -56,7 +56,9 @@ CombinedImagePackModel::data(const QModelIndex &index, int role) const
if (hasIndex(index.row(), index.column(), index.parent())) {
switch (role) {
case CompletionModel::CompletionRole:
return QString::fromStdString(images[index.row()].image.url);
return QString("<img data-mx-emoticon height=32 src=\"%1\" alt=\"%2\" title=\"%2\">")
.arg(QString::fromStdString(images[index.row()].image.url).toHtmlEscaped(),
images[index.row()].shortcode);
case Roles::Url:
return QString::fromStdString(images[index.row()].image.url);
case CompletionModel::SearchRole: