mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Merge pull request #1609 from MrDowntempo/feat/All-Emojis
Adds an ALL emoji category
This commit is contained in:
@@ -521,6 +521,7 @@
|
||||
"development": "Development",
|
||||
"education": "Education",
|
||||
"emoji-activity": "Activity",
|
||||
"emoji-all": "All",
|
||||
"emoji-animals": "Animals",
|
||||
"emoji-flags": "Flags",
|
||||
"emoji-food": "Food & Drink",
|
||||
|
||||
@@ -23,6 +23,7 @@ Item {
|
||||
readonly property string emptyBrowsingMessage: selectedCategory === "recent" ? I18n.tr("launcher.providers.emoji-no-recent") : ""
|
||||
|
||||
property var categoryIcons: ({
|
||||
"all": "apps",
|
||||
"recent": "clock",
|
||||
"people": "user",
|
||||
"animals": "paw",
|
||||
@@ -35,10 +36,11 @@ Item {
|
||||
"flags": "flag"
|
||||
})
|
||||
|
||||
property var categories: ["recent", "people", "animals", "nature", "food", "activity", "travel", "objects", "symbols", "flags"]
|
||||
property var categories: ["all", "recent", "people", "animals", "nature", "food", "activity", "travel", "objects", "symbols", "flags"]
|
||||
|
||||
function getCategoryName(category) {
|
||||
const names = {
|
||||
"all": I18n.tr("launcher.categories.emoji-all"),
|
||||
"recent": I18n.tr("launcher.categories.emoji-recent"),
|
||||
"people": I18n.tr("launcher.categories.emoji-people"),
|
||||
"animals": I18n.tr("launcher.categories.emoji-animals"),
|
||||
@@ -121,15 +123,12 @@ Item {
|
||||
}
|
||||
|
||||
var query = searchText.slice(6).trim();
|
||||
var emojis = [];
|
||||
|
||||
if (query === "") {
|
||||
showsCategories = true;
|
||||
var emojis = EmojiService.getEmojisByCategory(selectedCategory);
|
||||
return emojis.map(formatEmojiEntry);
|
||||
if (query !== "" || selectedCategory === "all") {
|
||||
emojis = EmojiService.search(query);
|
||||
} else {
|
||||
showsCategories = false;
|
||||
var emojis = EmojiService.search(query);
|
||||
return emojis.map(formatEmojiEntry);
|
||||
emojis = EmojiService.getEmojisByCategory(selectedCategory);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ Singleton {
|
||||
|
||||
if (!query || query.trim() === "") {
|
||||
// Return popular/recently used emojis, fallback to all emojis sorted by usage
|
||||
return _getPopularEmojis(50);
|
||||
return emojis;
|
||||
}
|
||||
|
||||
const terms = query.toLowerCase().split(" ").filter(t => t);
|
||||
|
||||
Reference in New Issue
Block a user