status-desktop/ui/shared/status/StatusEmojiSuggestionPopup.qml
emizzle 417194e7b4 feat: Keyboard shortcuts
Add keyboard shortcuts according to https://notes.status.im/02cfVf1KQLeQU2SqrIi9tw

fix: update chat message bubbles
- Align emojis to middle of text
- Add line-height as per design
- Properly support RTL languages (right-aligned) and LTR languages (left-aligned)
- Remove unneeded non-breaking space at the beginning of current user messages
- Properly support markdown for bold, strikethrough, and italic
- Fix text being removed when in between strikethrough markdown (~~)

fix: emoji resolution update for high resolution monitors
- Emojis now use the 72x72 original set, but are down-scaled to 20x20 (in chat bubbles) or 22x22 in other places, effectively tripling their pixel density

feat: handle new lines in blockquote

Handle new lines in blockquote so that messages display correctly.

Also, add functionality when a new line is entered in to the chat input, if it's inside a blockquote, a new ">" will be added automatically. This is also handled when backspace is entered.

feat: update xss to support full qt html4 table and table-cell attributes
2020-11-26 11:33:32 -05:00

38 lines
1.0 KiB
QML

import QtQuick 2.13
import QtQuick.Controls 2.13
import QtGraphicalEffects 1.12
import QtQuick.Dialogs 1.3
import "../../imports"
import "../../shared"
StatusInputListPopup {
property string shortname
id: emojiSuggestions
getImageSource: function (modelData) {
return `../../imports/twemoji/72x72/${modelData.unicode}.png`
}
getText: function (modelData) {
return modelData.shortname
}
onClicked: function (index) {
emojiSuggestions.addEmoji(index)
}
function openPopup(emojisParam, shortnameParam) {
modelList = emojisParam
shortname = shortnameParam
emojiSuggestions.open()
}
function addEmoji(index) {
if (index === undefined) {
index = listView.currentIndex
}
const message = extrapolateCursorPosition();
const unicode = emojiSuggestions.modelList[index].unicode_alternates || emojiSuggestions.modelList[index].unicode
replaceWithEmoji(message, emojiSuggestions.shortname, unicode)
}
}