2020-10-20 15:32:03 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtGraphicalEffects 1.12
|
|
|
|
import QtQuick.Dialogs 1.3
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
2020-10-20 15:32:03 +00:00
|
|
|
|
|
|
|
StatusInputListPopup {
|
2021-12-08 21:20:43 +00:00
|
|
|
id: emojiSuggestions
|
2020-10-20 15:32:03 +00:00
|
|
|
property string shortname
|
2022-01-11 23:16:17 +00:00
|
|
|
property string unicode: {
|
|
|
|
if(listView.currentIndex < 0 || listView.currentIndex >= emojiSuggestions.modelList.count)
|
|
|
|
return ""
|
|
|
|
|
|
|
|
return emojiSuggestions.modelList[listView.currentIndex].unicode_alternates ||
|
|
|
|
emojiSuggestions.modelList[listView.currentIndex].unicode
|
|
|
|
}
|
2020-10-20 15:32:03 +00:00
|
|
|
|
|
|
|
getImageSource: function (modelData) {
|
2021-10-29 11:58:07 +00:00
|
|
|
return `../../assets/twemoji/72x72/${modelData.unicode}.png`
|
2020-10-20 15:32:03 +00:00
|
|
|
}
|
|
|
|
getText: function (modelData) {
|
|
|
|
return modelData.shortname
|
|
|
|
}
|
2022-01-24 17:59:59 +00:00
|
|
|
getId: function (modelData) {
|
|
|
|
return modelData.unicode
|
|
|
|
}
|
2020-10-20 15:32:03 +00:00
|
|
|
onClicked: function (index) {
|
|
|
|
emojiSuggestions.addEmoji(index)
|
|
|
|
}
|
|
|
|
|
|
|
|
function openPopup(emojisParam, shortnameParam) {
|
|
|
|
modelList = emojisParam
|
|
|
|
shortname = shortnameParam
|
|
|
|
emojiSuggestions.open()
|
|
|
|
}
|
|
|
|
}
|