mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2025-12-06 06:36:15 +00:00
Autoformat
This commit is contained in:
@@ -3,9 +3,9 @@ import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Widgets
|
||||
import "../../../Helpers/FuzzySort.js" as Fuzzysort
|
||||
|
||||
import "Plugins"
|
||||
import "../../../Helpers/FuzzySort.js" as Fuzzysort
|
||||
import qs.Commons
|
||||
import qs.Modules.MainScreen
|
||||
import qs.Services.Keyboard
|
||||
@@ -215,24 +215,24 @@ SmartPanel {
|
||||
} else if (searchText.length > 1) {
|
||||
// Filter commands using fuzzy search when typing partial command
|
||||
const query = searchText.substring(1); // Remove the ">" prefix
|
||||
|
||||
|
||||
if (typeof Fuzzysort !== 'undefined') {
|
||||
// Use fuzzy search to filter commands
|
||||
const fuzzyResults = Fuzzysort.go(query, allCommands, {
|
||||
"keys": ["name"],
|
||||
"threshold": -1000,
|
||||
"limit": 50
|
||||
});
|
||||
|
||||
"keys": ["name"],
|
||||
"threshold": -1000,
|
||||
"limit": 50
|
||||
});
|
||||
|
||||
// Convert fuzzy results back to command objects
|
||||
results = fuzzyResults.map(result => result.obj);
|
||||
} else {
|
||||
// Fallback to simple substring matching
|
||||
const queryLower = query.toLowerCase();
|
||||
results = allCommands.filter(cmd => {
|
||||
const cmdName = (cmd.name || "").toLowerCase();
|
||||
return cmdName.includes(queryLower);
|
||||
});
|
||||
const cmdName = (cmd.name || "").toLowerCase();
|
||||
return cmdName.includes(queryLower);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,17 +15,17 @@ Item {
|
||||
property bool isBrowsingMode: false
|
||||
|
||||
property var categoryIcons: ({
|
||||
"recent": "clock",
|
||||
"people": "user",
|
||||
"animals": "paw",
|
||||
"nature": "leaf",
|
||||
"food": "apple",
|
||||
"activity": "run",
|
||||
"travel": "plane",
|
||||
"objects": "home",
|
||||
"symbols": "star",
|
||||
"flags": "flag"
|
||||
})
|
||||
"recent": "clock",
|
||||
"people": "user",
|
||||
"animals": "paw",
|
||||
"nature": "leaf",
|
||||
"food": "apple",
|
||||
"activity": "run",
|
||||
"travel": "plane",
|
||||
"objects": "home",
|
||||
"symbols": "star",
|
||||
"flags": "flag"
|
||||
})
|
||||
|
||||
property var categories: ["recent", "people", "animals", "nature", "food", "activity", "travel", "objects", "symbols", "flags"]
|
||||
|
||||
|
||||
@@ -71,7 +71,9 @@ SmartPanel {
|
||||
|
||||
Connections {
|
||||
target: NotificationService.historyList
|
||||
function onCountChanged() { recalcRangeCounts(); }
|
||||
function onCountChanged() {
|
||||
recalcRangeCounts();
|
||||
}
|
||||
}
|
||||
|
||||
Component.onCompleted: recalcRangeCounts()
|
||||
@@ -168,16 +170,12 @@ SmartPanel {
|
||||
|
||||
text: {
|
||||
if (rangeId === 0)
|
||||
return I18n.tr("notifications.range.all") +
|
||||
" (" + root.countForRange(rangeId) + ")";
|
||||
return I18n.tr("notifications.range.all") + " (" + root.countForRange(rangeId) + ")";
|
||||
else if (rangeId === 1)
|
||||
return I18n.tr("notifications.range.today") +
|
||||
" (" + root.countForRange(rangeId) + ")";
|
||||
return I18n.tr("notifications.range.today") + " (" + root.countForRange(rangeId) + ")";
|
||||
else if (rangeId === 2)
|
||||
return I18n.tr("notifications.range.yesterday") +
|
||||
" (" + root.countForRange(rangeId) + ")";
|
||||
return I18n.tr("notifications.range.earlier") +
|
||||
" (" + root.countForRange(rangeId) + ")";
|
||||
return I18n.tr("notifications.range.yesterday") + " (" + root.countForRange(rangeId) + ")";
|
||||
return I18n.tr("notifications.range.earlier") + " (" + root.countForRange(rangeId) + ")";
|
||||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
@@ -186,17 +184,15 @@ SmartPanel {
|
||||
fontSize: Style.fontSizeXS
|
||||
outlined: false
|
||||
|
||||
backgroundColor: isActive
|
||||
? Color.mPrimary
|
||||
: (hovered ? Color.mHover : Color.transparent)
|
||||
textColor: isActive
|
||||
? Color.mOnPrimary
|
||||
: (hovered ? Color.mOnHover : Color.mOnSurface)
|
||||
backgroundColor: isActive ? Color.mPrimary : (hovered ? Color.mHover : Color.transparent)
|
||||
textColor: isActive ? Color.mOnPrimary : (hovered ? Color.mOnHover : Color.mOnSurface)
|
||||
hoverColor: backgroundColor
|
||||
|
||||
Behavior on backgroundColor {
|
||||
enabled: !Settings.data.general.animationDisabled
|
||||
ColorAnimation { duration: Style.animationFast }
|
||||
ColorAnimation {
|
||||
duration: Style.animationFast
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: root.currentRange = rangeId
|
||||
|
||||
@@ -48,17 +48,17 @@ Singleton {
|
||||
}
|
||||
|
||||
function _getPopularEmojis(limit) {
|
||||
var emojisWithUsage = emojis.map(function(emoji) {
|
||||
var emojisWithUsage = emojis.map(function (emoji) {
|
||||
return {
|
||||
emoji: emoji,
|
||||
usageCount: usageCounts[emoji.emoji] || 0
|
||||
};
|
||||
}).filter(function(item) {
|
||||
}).filter(function (item) {
|
||||
return item.usageCount > 0;
|
||||
});
|
||||
|
||||
// Sort by usage count (descending), then by name
|
||||
emojisWithUsage.sort(function(a, b) {
|
||||
emojisWithUsage.sort(function (a, b) {
|
||||
if (b.usageCount !== a.usageCount) {
|
||||
return b.usageCount - a.usageCount;
|
||||
}
|
||||
@@ -66,7 +66,7 @@ Singleton {
|
||||
});
|
||||
|
||||
// Return the emoji objects limited by the specified count
|
||||
return emojisWithUsage.slice(0, limit).map(function(item) {
|
||||
return emojisWithUsage.slice(0, limit).map(function (item) {
|
||||
return item.emoji;
|
||||
});
|
||||
}
|
||||
@@ -90,9 +90,9 @@ Singleton {
|
||||
var categories = [];
|
||||
for (var cat in categoryCounts) {
|
||||
categories.push({
|
||||
name: cat,
|
||||
count: categoryCounts[cat]
|
||||
});
|
||||
name: cat,
|
||||
count: categoryCounts[cat]
|
||||
});
|
||||
}
|
||||
|
||||
return categories;
|
||||
@@ -107,7 +107,7 @@ Singleton {
|
||||
return _getPopularEmojis(25);
|
||||
}
|
||||
|
||||
return emojis.filter(function(emoji) {
|
||||
return emojis.filter(function (emoji) {
|
||||
return emoji.category === category;
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user