mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-06-05 11:40:00 +00:00
Autofmt
This commit is contained in:
@@ -35,16 +35,16 @@ Item {
|
||||
// Return available commands when user types ">"
|
||||
function commands() {
|
||||
return [
|
||||
{
|
||||
"name": ">emoji",
|
||||
"description": I18n.tr("plugins.emoji-search-description"),
|
||||
"icon": "emote",
|
||||
"isImage": false,
|
||||
"onActivate": function () {
|
||||
launcher.setSearchText(">emoji ");
|
||||
}
|
||||
}
|
||||
];
|
||||
{
|
||||
"name": ">emoji",
|
||||
"description": I18n.tr("plugins.emoji-search-description"),
|
||||
"icon": "emote",
|
||||
"isImage": false,
|
||||
"onActivate": function () {
|
||||
launcher.setSearchText(">emoji ");
|
||||
}
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
// Get search results
|
||||
@@ -55,14 +55,14 @@ Item {
|
||||
|
||||
if (!EmojiService.loaded) {
|
||||
return [
|
||||
{
|
||||
"name": I18n.tr("plugins.emoji-loading"),
|
||||
"description": I18n.tr("plugins.emoji-loading-description"),
|
||||
"icon": "view-refresh",
|
||||
"isImage": false,
|
||||
"onActivate": function () {}
|
||||
}
|
||||
];
|
||||
{
|
||||
"name": I18n.tr("plugins.emoji-loading"),
|
||||
"description": I18n.tr("plugins.emoji-loading-description"),
|
||||
"icon": "view-refresh",
|
||||
"isImage": false,
|
||||
"onActivate": function () {}
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
const query = searchText.slice(6).trim();
|
||||
|
||||
@@ -835,14 +835,14 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
NCheckbox {
|
||||
label: "Telegram"
|
||||
description: ProgramCheckerService.telegramAvailable ? I18n.tr("settings.color-scheme.templates.programs.telegram.description", {
|
||||
"filepath": "~/.config/telegram-desktop/themes/noctalia.tdesktop-theme"
|
||||
}) : I18n.tr("settings.color-scheme.templates.programs.telegram.description-missing", {
|
||||
"app": "telegram"
|
||||
})
|
||||
"filepath": "~/.config/telegram-desktop/themes/noctalia.tdesktop-theme"
|
||||
}) : I18n.tr("settings.color-scheme.templates.programs.telegram.description-missing", {
|
||||
"app": "telegram"
|
||||
})
|
||||
checked: Settings.data.templates.telegram
|
||||
enabled: ProgramCheckerService.telegramAvailable
|
||||
opacity: ProgramCheckerService.telegramAvailable ? 1.0 : 0.6
|
||||
|
||||
@@ -21,7 +21,7 @@ ColumnLayout {
|
||||
checked: Settings.data.general.compactLockScreen
|
||||
onToggled: checked => Settings.data.general.compactLockScreen = checked
|
||||
}
|
||||
|
||||
|
||||
NToggle {
|
||||
label: I18n.tr("settings.lock-screen.show-hibernate.label")
|
||||
description: I18n.tr("settings.lock-screen.show-hibernate.description")
|
||||
|
||||
@@ -31,18 +31,18 @@ Singleton {
|
||||
|
||||
const terms = query.toLowerCase().split(" ").filter(t => t);
|
||||
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);
|
||||
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);
|
||||
|
||||
if (!emojiMatch && !nameMatch && !keywordMatch && !categoryMatch) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
if (!emojiMatch && !nameMatch && !keywordMatch && !categoryMatch) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
});
|
||||
|
||||
return results;
|
||||
}
|
||||
@@ -51,19 +51,19 @@ Singleton {
|
||||
function _getPopularEmojis(limit) {
|
||||
// Create array of emojis with their usage counts
|
||||
const emojisWithUsage = emojis.map(emoji => {
|
||||
return {
|
||||
emoji: emoji,
|
||||
usageCount: usageCounts[emoji.emoji] || 0
|
||||
};
|
||||
});
|
||||
return {
|
||||
emoji: emoji,
|
||||
usageCount: usageCounts[emoji.emoji] || 0
|
||||
};
|
||||
});
|
||||
|
||||
// Sort by usage count (descending), then by name
|
||||
emojisWithUsage.sort((a, b) => {
|
||||
if (b.usageCount !== a.usageCount) {
|
||||
return b.usageCount - a.usageCount;
|
||||
}
|
||||
return (a.emoji.name || "").localeCompare(b.emoji.name || "");
|
||||
});
|
||||
if (b.usageCount !== a.usageCount) {
|
||||
return b.usageCount - a.usageCount;
|
||||
}
|
||||
return (a.emoji.name || "").localeCompare(b.emoji.name || "");
|
||||
});
|
||||
|
||||
// Return the emoji objects limited by the specified count
|
||||
return emojisWithUsage.slice(0, limit).map(item => item.emoji);
|
||||
@@ -120,7 +120,7 @@ Singleton {
|
||||
_onLoadComplete();
|
||||
}
|
||||
|
||||
onLoadFailed: function(error) {
|
||||
onLoadFailed: function (error) {
|
||||
_userEmojiData = [];
|
||||
_onLoadComplete();
|
||||
}
|
||||
@@ -147,7 +147,7 @@ Singleton {
|
||||
_onLoadComplete();
|
||||
}
|
||||
|
||||
onLoadFailed: function(error) {
|
||||
onLoadFailed: function (error) {
|
||||
_builtinEmojiData = [];
|
||||
_onLoadComplete();
|
||||
}
|
||||
@@ -215,7 +215,7 @@ Singleton {
|
||||
}
|
||||
}
|
||||
|
||||
onLoadFailed: function(error) {
|
||||
onLoadFailed: function (error) {
|
||||
root.usageCounts = {};
|
||||
Qt.callLater(_ensureUsageFileExists);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user