feat: Upgrade emoji selection to support latest emojis
- upgrade to latest TWEmoji 15.1.0 from https://github.com/jdecked/twemoji (the original twemoji is abandonware now) - create new EmojiJSON metadata from https://github.com/milesj/emojibase - removed unused 26x26 assets - add storybook page for StatusEmojiPopup Fixes #8979
|
@ -0,0 +1,90 @@
|
|||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import Qt.labs.settings 1.1
|
||||
|
||||
import StatusQ.Core.Theme 0.1
|
||||
import StatusQ.Core.Utils 0.1 as StatusQUtils
|
||||
|
||||
import Storybook 1.0
|
||||
|
||||
import utils 1.0
|
||||
import shared.status 1.0
|
||||
|
||||
SplitView {
|
||||
id: root
|
||||
orientation: Qt.Vertical
|
||||
|
||||
Logs { id: logs }
|
||||
|
||||
QtObject {
|
||||
id: d
|
||||
property string lastSelectedEmoji: "N/A"
|
||||
}
|
||||
|
||||
Pane {
|
||||
SplitView.fillWidth: true
|
||||
SplitView.fillHeight: true
|
||||
|
||||
background: Rectangle {
|
||||
color: Theme.palette.baseColor3
|
||||
}
|
||||
|
||||
Button {
|
||||
anchors.centerIn: parent
|
||||
text: "Reopen"
|
||||
onClicked: emojiPopup.open()
|
||||
}
|
||||
|
||||
Settings {
|
||||
id: settings
|
||||
category: "EmojiPopup"
|
||||
property var recentEmojis: []
|
||||
property string skinColor
|
||||
}
|
||||
|
||||
StatusEmojiPopup {
|
||||
id: emojiPopup
|
||||
height: 440
|
||||
visible: true
|
||||
modal: false
|
||||
anchors.centerIn: parent
|
||||
settings: settings
|
||||
onEmojiSelected: d.lastSelectedEmoji = emoji
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
LogsAndControlsPanel {
|
||||
SplitView.minimumHeight: 200
|
||||
SplitView.preferredHeight: 200
|
||||
|
||||
logsView.logText: logs.logText
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
Button {
|
||||
text: "Clear settings (reload to take effect)"
|
||||
onClicked: {
|
||||
settings.recentEmojis = []
|
||||
settings.skinColor = ""
|
||||
settings.sync()
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
text: "Last selected: %1".arg(d.lastSelectedEmoji)
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Random emoji"
|
||||
onClicked: d.lastSelectedEmoji = StatusQUtils.Emoji.getRandomEmoji()
|
||||
}
|
||||
|
||||
Item { Layout.fillHeight: true }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// category: Popups
|
|
@ -87,7 +87,6 @@ QtObject {
|
|||
return value.match(emojiRegexp, "$1");
|
||||
}
|
||||
function getEmojiUnicode(shortname) {
|
||||
|
||||
const _emoji = EmojiJSON.emoji_json.find(function(emoji) {
|
||||
return (emoji.shortname === shortname)
|
||||
})
|
||||
|
@ -130,8 +129,8 @@ QtObject {
|
|||
|
||||
// Used to exclude flags emojis from the random emoji picker
|
||||
// Based on the knowledge that flags emojis are contiguous in the emoji list
|
||||
readonly property int firstFlagIndex: 1003
|
||||
readonly property int lastFlagIndex: 1259
|
||||
readonly property int firstFlagIndex: 3504
|
||||
readonly property int lastFlagIndex: 3772
|
||||
readonly property int flagsCount: lastFlagIndex - firstFlagIndex + 1
|
||||
|
||||
// Returns a random emoji excluding flags emojis
|
||||
|
|
Before Width: | Height: | Size: 1012 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 934 B |
Before Width: | Height: | Size: 855 B |
Before Width: | Height: | Size: 850 B |
Before Width: | Height: | Size: 788 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 995 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 876 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1020 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 833 B |
Before Width: | Height: | Size: 671 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 989 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 843 B |
Before Width: | Height: | Size: 468 B |
Before Width: | Height: | Size: 906 B |
Before Width: | Height: | Size: 822 B |
Before Width: | Height: | Size: 553 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 422 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 621 B |
Before Width: | Height: | Size: 640 B |
Before Width: | Height: | Size: 703 B |
Before Width: | Height: | Size: 915 B |
Before Width: | Height: | Size: 960 B |
Before Width: | Height: | Size: 671 B |
Before Width: | Height: | Size: 674 B |
Before Width: | Height: | Size: 476 B |
Before Width: | Height: | Size: 579 B |
Before Width: | Height: | Size: 478 B |
Before Width: | Height: | Size: 651 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 594 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 714 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 993 B |
Before Width: | Height: | Size: 659 B |
Before Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 629 B |
Before Width: | Height: | Size: 422 B |
Before Width: | Height: | Size: 881 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 857 B |
Before Width: | Height: | Size: 824 B |
Before Width: | Height: | Size: 960 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 906 B |
Before Width: | Height: | Size: 618 B |
Before Width: | Height: | Size: 556 B |
Before Width: | Height: | Size: 476 B |
Before Width: | Height: | Size: 1.4 KiB |
Before Width: | Height: | Size: 708 B |
Before Width: | Height: | Size: 567 B |
Before Width: | Height: | Size: 663 B |
Before Width: | Height: | Size: 475 B |
Before Width: | Height: | Size: 476 B |
Before Width: | Height: | Size: 659 B |
Before Width: | Height: | Size: 770 B |
Before Width: | Height: | Size: 881 B |
Before Width: | Height: | Size: 592 B |
Before Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 792 B |
Before Width: | Height: | Size: 838 B |
Before Width: | Height: | Size: 883 B |
Before Width: | Height: | Size: 475 B |
Before Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 934 B |
Before Width: | Height: | Size: 608 B |
Before Width: | Height: | Size: 885 B |
Before Width: | Height: | Size: 885 B |
Before Width: | Height: | Size: 807 B |
Before Width: | Height: | Size: 841 B |
Before Width: | Height: | Size: 737 B |
Before Width: | Height: | Size: 779 B |
Before Width: | Height: | Size: 475 B |
Before Width: | Height: | Size: 736 B |
Before Width: | Height: | Size: 898 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 737 B |
Before Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 742 B |
Before Width: | Height: | Size: 799 B |