mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-05-31 01:36:50 +00:00
fix: remove unnecessary fallbacks and redundant code
This commit is contained in:
@@ -774,8 +774,8 @@ SmartPanel {
|
||||
NText {
|
||||
id: emojiDisplay
|
||||
anchors.centerIn: parent
|
||||
visible: modelData.emojiChar ? true : (!imagePreview.visible && !iconLoader.visible)
|
||||
text: modelData.emojiChar ? modelData.emojiChar : (modelData.name ? modelData.name.charAt(0).toUpperCase() : "?")
|
||||
visible: modelData.emojiChar || (!imagePreview.visible && !iconLoader.visible)
|
||||
text: modelData.emojiChar ? modelData.emojiChar : modelData.name.charAt(0).toUpperCase()
|
||||
pointSize: modelData.emojiChar ? Style.fontSizeXXXL : Style.fontSizeXXL // Larger font for emojis
|
||||
font.weight: Style.fontWeightBold
|
||||
color: modelData.emojiChar ? Color.mOnSurface : Color.mOnPrimary // Different color for emojis
|
||||
@@ -1016,8 +1016,8 @@ SmartPanel {
|
||||
NText {
|
||||
id: gridEmojiDisplay
|
||||
anchors.centerIn: parent
|
||||
visible: modelData.emojiChar ? true : (!gridImagePreview.visible && !gridIconLoader.visible)
|
||||
text: modelData.emojiChar ? modelData.emojiChar : (modelData.name ? modelData.name.charAt(0).toUpperCase() : "?")
|
||||
visible: modelData.emojiChar || (!gridImagePreview.visible && !gridIconLoader.visible)
|
||||
text: modelData.emojiChar ? modelData.emojiChar : modelData.name.charAt(0).toUpperCase()
|
||||
pointSize: modelData.emojiChar ? Style.fontSizeXXL * 2 : Style.fontSizeXL
|
||||
font.weight: Style.fontWeightBold
|
||||
color: modelData.emojiChar ? Color.mOnSurface : Color.mOnPrimary
|
||||
|
||||
@@ -33,8 +33,7 @@ Item {
|
||||
target: EmojiService
|
||||
function onLoadedChanged() {
|
||||
if (EmojiService.loaded && root.launcher) {
|
||||
// Update launcher results to refresh the UI
|
||||
root.launcher?.updateResults();
|
||||
root.launcher.updateResults();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,7 +104,7 @@ Item {
|
||||
// Format an emoji entry for the results list
|
||||
function formatEmojiEntry(emoji) {
|
||||
let title = emoji.name;
|
||||
let description = (emoji.keywords || []).join(", ");
|
||||
let description = emoji.keywords.join(", ");
|
||||
|
||||
if (emoji.category) {
|
||||
description += " • Category: " + emoji.category;
|
||||
|
||||
@@ -33,9 +33,9 @@ Singleton {
|
||||
const results = emojis.filter(emoji => {
|
||||
for (let term of terms) {
|
||||
const emojiMatch = emoji.emoji.toLowerCase().includes(term);
|
||||
const nameMatch = (emoji.name || "").toLowerCase().includes(term);
|
||||
const keywordMatch = (emoji.keywords || []).some(kw => kw.toLowerCase().includes(term));
|
||||
const categoryMatch = (emoji.category || "").toLowerCase().includes(term);
|
||||
const nameMatch = emoji.name.toLowerCase().includes(term);
|
||||
const keywordMatch = emoji.keywords.some(kw => kw.toLowerCase().includes(term));
|
||||
const categoryMatch = emoji.category.toLowerCase().includes(term);
|
||||
|
||||
if (!emojiMatch && !nameMatch && !keywordMatch && !categoryMatch) {
|
||||
return false;
|
||||
@@ -62,7 +62,7 @@ Singleton {
|
||||
if (b.usageCount !== a.usageCount) {
|
||||
return b.usageCount - a.usageCount;
|
||||
}
|
||||
return (a.emoji.name || "").localeCompare(b.emoji.name || "");
|
||||
return a.emoji.name.localeCompare(b.emoji.name);
|
||||
});
|
||||
|
||||
// Return the emoji objects limited by the specified count
|
||||
|
||||
Reference in New Issue
Block a user