TemplateSubTab: add tag specific filtering

This commit is contained in:
Ly-sec
2026-01-15 11:06:18 +01:00
parent 84e9720517
commit 37e1be3ac6
4 changed files with 160 additions and 47 deletions
+3 -1
View File
@@ -746,6 +746,8 @@
"predefined-generate-templates-label": "Generate templates for predefined schemes",
"predefined-title": "Predefined color schemes",
"templates-desc": "Apply colors to external applications.",
"templates-filter-label": "Filter by category",
"templates-filter-description": "Show templates from a specific category.",
"templates-misc-description": "Create your own templates.",
"templates-misc-label": "Advanced",
"templates-misc-user-templates-description": "Only enable if you know what you are doing — refer to our online documentation",
@@ -1719,4 +1721,4 @@
"poor": "Poor"
}
}
}
}
+71 -17
View File
@@ -4,9 +4,9 @@
"close-app": "關閉 {app}",
"connect-vpn": "連線至 {name}",
"cycle-visualizer": "切換視覺效果樣式",
"disable-bluetooth": "停用藍牙",
"disable-bluetooth": "關閉藍牙",
"disable-dnd": "停用勿擾模式",
"disable-wifi": "停用 Wi-Fi",
"disable-wifi": "關閉 Wi-Fi",
"disconnect-vpn": "自 {name} 斷開連線",
"enable-bluetooth": "啟用藍牙",
"enable-dnd": "啟用勿擾模式",
@@ -14,8 +14,8 @@
"launcher-settings": "啟動器設定",
"lower-to-bottom": "下移至底部",
"open-calendar": "開啟行事曆",
"open-display-settings": "顯示設定",
"open-launcher": "開啟動器",
"open-display-settings": "顯示設定",
"open-launcher": "開啟動器",
"open-settings": "開啟設定",
"raise-to-top": "上移至頂部",
"random-wallpaper": "隨機桌布",
@@ -40,7 +40,7 @@
"audio-visualizer": {
"color-name-description": "選取視覺效果的顏色",
"color-name-label": "填充顏色",
"hide-when-idle-description": "當啟用時, 除非有正在播放的媒體, 否則就隱藏視覺效果",
"hide-when-idle-description": "當啟用時, 如果沒有正在播放的媒體就隱藏視覺效果",
"hide-when-idle-label": "無任何媒體播放時隱藏",
"width-description": "自訂部件寬度"
},
@@ -58,7 +58,7 @@
"show-power-profile-label": "顯示電源配置"
},
"clock": {
"clock-display-description": "利用下面列表的標記自訂你想要的時鐘格式; 如果想用12小時制, 你必須要再增加 \"AP\" 標記",
"clock-display-description": "利用下面列表的標記自訂你想要的時鐘格式; 如果想使用12小時制, 你必須要再增加 \"AP\" 標記",
"clock-display-label": "時鐘顯示",
"custom-font-description": "選取時鐘顯示使用的自訂字型",
"custom-font-label": "自訂字型",
@@ -67,8 +67,9 @@
"horizontal-bar-description": "提示: 可以利用 \\n 換行",
"horizontal-bar-label": "水平列顯示",
"preview": "預覽",
"tooltip-format-description": "在游標移過時提示框所顯示的格式, 如果留空則使用預設值",
"tooltip-format-label": "提示框格式",
"use-custom-font-description": "強制為時鐘套用自訂的字型",
"use-custom-font-description": "為時鐘強制套用自訂的字型",
"use-custom-font-label": "使用自訂字型",
"use-monospaced-font-description": "當啟用時, 時鐘會使用等寬字型",
"use-monospaced-font-label": "使用等寬字型",
@@ -99,23 +100,34 @@
"ipc-identifier-label": "IPC 識別碼",
"left-click-description": "在點擊左鍵時要執行的指令",
"left-click-label": "點擊左鍵",
"left-click-update-text": "在點擊左鍵時更新顯示文字",
"middle-click-description": "在點擊中鍵時要執行的指令",
"middle-click-label": "點擊中鍵",
"middle-click-update-text": "在點擊中鍵時更新顯示文字",
"parse-json-description": "將執行的指令輸出為 JSON 物件來動態設置文字及圖示",
"parse-json-label": "將輸出解析為 JSON",
"refresh-interval-description": "間格以毫秒 (ms) 計",
"refresh-interval-label": "重整間格",
"right-click-description": "在點擊右鍵時要執行的指令",
"right-click-label": "點擊右鍵",
"right-click-update-text": "在點擊右鍵時更新顯示文字",
"show-icon-description": "切換小工具圖示的能見性",
"show-icon-label": "顯示圖示",
"wheel-down-description": "在滾輪下滾時要執行的指令",
"wheel-down-label": "滾輪下滾",
"wheel-label": "滑鼠滾輪",
"wheel-mode-separate-description": "分別在滾輪上滾及下滾時執行不同指令",
"wheel-mode-separate-label": "分開設定滾輪指令",
"wheel-up-description": "在滾輪上滾時要執行的指令",
"wheel-up-label": "滾輪上滾"
"wheel-up-label": "滾輪上滾",
"wheel-update-text": "在滾動滾輪時更新顯示文字"
},
"keyboard-layout": {
"show-icon-description": "以圖示顯示鍵盤佈局"
},
"lock-keys": {
"hide-when-off-label": "關閉時隱藏",
"hide-when-off-description": "當按鍵不是啟動狀態時隱藏",
"hide-when-off-label": "停用時隱藏",
"show-caps-lock-description": "顯示 Caps Lock的狀態",
"show-caps-lock-label": "Caps Lock",
"show-num-lock-description": "顯示 Num Lock 的狀態",
@@ -127,8 +139,8 @@
"compact-mode-description": "替媒體播放面板換一個省空間的佈局",
"compact-mode-label": "緊湊模式",
"hide-mode-description": "控制當沒有媒體播放時小工具的行為",
"max-width-description": "設定小工具的最大水平寬度, 當內容簡短時小工具會跟著縮短",
"no-active-player": "沒有動的媒體",
"max-width-description": "設定小工具的最大水平寬度, 當標題簡短時小工具會跟著縮短",
"no-active-player": "沒有動的媒體",
"panel-section-description": "控制媒體播放面板的外觀及行為",
"panel-section-label": "媒體播放面板",
"scrolling-mode-description": "控制歌曲長標題時是否啟用文字捲動",
@@ -141,12 +153,15 @@
"show-progress-ring-label": "顯示進度圓圈",
"show-visualizer-description": "在音樂播放時為音訊顯示視覺效果",
"show-visualizer-label": "顯示視覺效果",
"use-fixed-width-description": "當啟用時, 小工具將總是使用最大寬度而不會配合內容調整",
"use-fixed-width-description": "當啟用時, 小工具將總是使用最大寬度而不會配合標題調整",
"use-fixed-width-label": "使用固定寬度",
"visualizer-type-description": "選擇視覺效果的顯示風格",
"visualizer-type-label": "視覺效果樣式"
},
"notification-history": {
"hide-widget-when-zero-description": "如果沒有任何未讀通知就隱藏通知圖示",
"hide-widget-when-zero-label": "零通知時隱藏圖示",
"show-unread-badge-description": "顯示帶有數量的未讀標記",
"show-unread-badge-label": "顯示未讀標記"
},
"section-editor": {
@@ -168,7 +183,7 @@
"gpu-temperature-description": "如果可用即顯示 GPU 溫度",
"load-average-description": "顯示系統負載",
"load-average-label": "系統負載",
"memory-percentage-description": "顯示記憶體的使用百分比而不數值表示",
"memory-percentage-description": "顯示記憶體的使用百分比而不數值表示",
"memory-percentage-label": "記憶體百分比",
"memory-usage-description": "顯示現在的記憶體使用量",
"memory-usage-label": "記憶體使用量",
@@ -187,21 +202,39 @@
"icon-scale-label": "圖示比例",
"max-width-description": "工具列佔螢幕寬度百分比的最大寬度",
"max-width-label": "最大寬度",
"only-active-workspaces-description": "只顯示活躍中的工作區所執行的程式",
"only-active-workspaces-label": "來自現在活躍的工作區",
"only-same-monitor-description": "只顯示工具列所在的這個顯示器在執行的程式",
"only-same-monitor-label": "來自同個顯示器",
"show-pinned-apps-description": "顯示有在 Dock 標記為釘選的程式",
"show-pinned-apps-label": "顯示釘選的程式",
"show-title-description": "顯示視窗的標題",
"show-title-description-disabled": "當垂直顯示時不支援顯示標題",
"show-title-label": "顯示標題",
"smart-width-description": "基於視窗的多寡自動調整每個視窗佔用的寬度",
"smart-width-label": "智慧寬度",
"title-width-description": "設定工具列視窗標題的寬度 (以像素 (px) 計)",
"title-width-label": "標題寬度",
"title-width-reset-tooltip": "重設寬度"
},
"tray": {
"colorize-icons-description": "將系統夾圖示套用主題用色"
"colorize-icons-description": "將系統夾圖示套用主題用色",
"drawer-enabled-description": "當啟用時, 沒有釘選的系統匣圖示將會顯示在抽屜面板中<br>如果停用則所有的圖示都會在工具列裡顯示",
"drawer-enabled-label": "啟用抽屜",
"hide-passive-description": "當啟用時, 在 \"被動\" 狀態下的系統匣圖示將會被隱藏",
"hide-passive-label": "隱藏被動項目"
},
"volume": {
"display-mode-description": "選擇你想如何顯示音量數值",
"display-mode-label": "顯示模式"
},
"workspace": {
"character-count-description": "限制工作區所設定的名字要顯示幾個字元 (1-10)",
"character-count-label": "字元上限",
"enable-scrollwheel-description": "利用滑鼠滾輪在工作區間切換",
"enable-scrollwheel-label": "捲輪切換工作區",
"grouped-border-opacity-description": "設定工作區邊框的不透明度",
"grouped-border-opacity-label": "邊框不透明度",
"hide-unoccupied-description": "如果工作區沒有任何視窗則不要顯示",
"hide-unoccupied-label": "沒有佔用時隱藏",
"label-mode-description": "選擇工作區標籤該如何顯示",
@@ -230,7 +263,7 @@
"blocked": "已封鎖",
"connected-devices": "已連接的裝置",
"device-address": "裝置位址",
"disabled": "藍牙已停用",
"disabled": "藍牙已關閉",
"discoverable": "可被偵測",
"enable-message": "啟用藍芽來檢視可用裝置",
"known-devices": "已知裝置",
@@ -267,6 +300,7 @@
},
"colors": {
"error": "錯誤",
"on-surface": "工具列表面",
"primary": "主要色",
"secondary": "輔助色",
"tertiary": "三級色"
@@ -285,13 +319,16 @@
"calendar": "行事曆",
"calendar-panel": "行事曆面板",
"cancel": "取消",
"cards": "卡片",
"charging": "正在充電",
"clear": "清空",
"clipboard": "剪貼簿",
"close": "關閉",
"colors": "顏色",
"command": "指令",
"connect": "連接",
"connected": "已連接",
"connecting": "正在連線...",
"contributors": "貢獻者",
"date": "日期",
"delete": "刪除",
@@ -300,14 +337,19 @@
"discharging": "放電中",
"disconnect": "斷線",
"disconnected": "已斷線",
"disconnecting": "正在斷線...",
"download": "下載",
"enabled": "已啟用",
"events": "事件",
"execute": "執行",
"focus": "關注",
"frequency": "頻率",
"gateway": "網路閘道",
"general": "一般",
"hibernate": "睡眠",
"history": "歷史",
"icon": "圖示",
"idle": "閒置",
"input": "輸入",
"install": "安裝",
"installed": "已安裝",
@@ -352,6 +394,7 @@
"signal": "訊號",
"start": "開始",
"stop": "停止",
"suspend": "暫停",
"templates": "模板",
"test": "測試",
"title": "標題",
@@ -364,6 +407,7 @@
"upload": "上傳",
"version": "版本",
"visualizer": "視覺效果",
"volumes": "音量",
"wallpaper": "桌布",
"weather": "天氣",
"weather-loading": "載入現在天氣...",
@@ -441,7 +485,7 @@
"no-notifications": "沒有任何通知"
},
"range": {
"earlier": "更早",
"earlier": "更早以前",
"today": "今天",
"yesterday": "昨天"
},
@@ -482,6 +526,11 @@
"centered": "置中面板",
"window": "分離視窗"
},
"visualizer-types": {
"linear": "線條",
"mirrored": "鏡像",
"wave": "波形"
},
"workspace-labels": {
"index": "編號",
"index-and-name": "編號及名稱",
@@ -516,6 +565,7 @@
"system-title": "系統資訊:",
"system-uptime": "開機時間:",
"system-wm": "視窗管理器:",
"telemetry-desc": "提供匿名化的系統資訊 (畫面解析度, 合成器, 發行版) 幫助 Noctalia 改進; 只在桌面啟動時執行, 沒有額外追蹤; 傳送的資料會在30天後自動刪除",
"telemetry-enabled": "傳送匿名化的系統資訊",
"telemetry-show-data": "檢視資料",
"telemetry-title": "隱私",
@@ -537,11 +587,15 @@
"media-desc": "設定你偏好或想忽略的媒體播放程式",
"media-excluded-player-label": "排除的播放器",
"media-frame-rate-description": "頻率越高效果越滑順, 但也會用愈多資源",
"media-frame-rate-label": "幀數",
"media-primary-player-placeholder": "例如: spotify, vlc, mpv",
"media-scrolling-speed-description": "以秒為單位設定標題從頭捲動一輪的時間",
"media-scrolling-speed-label": "捲動速度",
"media-scrolling-title-description": "在碰到長媒體標題時啟用持續捲動",
"media-scrolling-title-label": "曲目捲動",
"media-title": "媒體播放器",
"panel-applications-empty": "沒有任何程式正在播放音訊",
"on-middle-clicked-description": "在點擊中鍵時要執行的指令",
"panel-applications-empty": "沒有程式正在播放音訊",
"title": "音訊",
"visualizer-type-description": "選擇媒體播放時的視覺效果樣式",
"visualizer-type-label": "視覺效果樣式",
@@ -24,7 +24,7 @@ ColumnLayout {
});
}
// Add terminals
// Add terminals with category "terminal"
for (var i = 0; i < TemplateRegistry.terminals.length; i++) {
var t = TemplateRegistry.terminals[i];
templates.push({
@@ -74,7 +74,7 @@ ColumnLayout {
templates.push({
"id": app.id,
"name": app.name,
"category": app.category || "applications",
"category": app.category || "misc",
"tooltip": getDesc(path)
});
}
@@ -85,24 +85,43 @@ ColumnLayout {
return templates;
}
// Category filter
property string selectedCategory: ""
// Build available categories dynamically
readonly property var availableCategories: {
var cats = {};
for (var i = 0; i < allTemplates.length; i++) {
cats[allTemplates[i].category] = true;
}
return Object.keys(cats).sort();
}
// Filter toggle
property bool showOnlyActive: false
// Filtered templates based on search and toggle
// Filtered templates based on category, search, and toggle
property string searchText: ""
readonly property var filteredTemplates: {
// Search overrides toggle
var result = allTemplates;
// Filter by category first (unless searching)
if (selectedCategory !== "" && searchText.trim() === "") {
result = result.filter(t => t.category === selectedCategory);
}
// Search overrides category filter
if (searchText.trim() !== "") {
var query = searchText.toLowerCase().trim();
return allTemplates.filter(t => t.name.toLowerCase().includes(query));
result = result.filter(t => t.name.toLowerCase().includes(query));
}
// Filter by active if enabled
if (showOnlyActive) {
return allTemplates.filter(t => isTemplateActive(t.id));
// Filter by active if enabled (and not searching)
if (showOnlyActive && searchText.trim() === "") {
result = result.filter(t => isTemplateActive(t.id));
}
return allTemplates;
return result;
}
// Check if a template is active
@@ -153,6 +172,44 @@ ColumnLayout {
Layout.fillWidth: true
}
// Category filter chips
NCollapsible {
Layout.fillWidth: true
label: I18n.tr("panels.color-scheme.templates-filter-label")
description: I18n.tr("panels.color-scheme.templates-filter-description")
expanded: true
contentSpacing: Style.marginXS
Flow {
Layout.fillWidth: true
spacing: Style.marginXS
flow: Flow.LeftToRight
Repeater {
model: [""].concat(root.availableCategories)
delegate: NButton {
text: {
if (modelData === "")
return I18n.tr("launcher.categories.all");
// Special case for UI to keep it uppercase
if (modelData === "system")
return "System";
// Capitalize first letter for others
return modelData.charAt(0).toUpperCase() + modelData.slice(1);
}
backgroundColor: root.selectedCategory === modelData ? Color.mPrimary : Color.mSurfaceVariant
textColor: root.selectedCategory === modelData ? Color.mOnPrimary : Color.mOnSurfaceVariant
onClicked: root.selectedCategory = modelData
fontSize: Style.fontSizeS
iconSize: Style.fontSizeS
fontWeight: Style.fontWeightSemiBold
buttonRadius: Style.iRadiusM
}
}
}
}
// Search/filter input row
RowLayout {
Layout.fillWidth: true
+20 -20
View File
@@ -51,7 +51,7 @@ Singleton {
{
"id": "gtk",
"name": "GTK",
"category": "ui",
"category": "system",
"input": "gtk.css",
"outputs": [
{
@@ -66,7 +66,7 @@ Singleton {
{
"id": "qt",
"name": "Qt",
"category": "ui",
"category": "system",
"input": "qtct.conf",
"outputs": [
{
@@ -80,7 +80,7 @@ Singleton {
{
"id": "kcolorscheme",
"name": "KColorScheme",
"category": "ui",
"category": "system",
"input": "kcolorscheme.colors",
"outputs": [
{
@@ -91,7 +91,7 @@ Singleton {
{
"id": "fuzzel",
"name": "Fuzzel",
"category": "launchers",
"category": "launcher",
"input": "fuzzel.conf",
"outputs": [
{
@@ -103,7 +103,7 @@ Singleton {
{
"id": "vicinae",
"name": "Vicinae",
"category": "launchers",
"category": "launcher",
"input": "vicinae.toml",
"outputs": [
{
@@ -115,7 +115,7 @@ Singleton {
{
"id": "walker",
"name": "Walker",
"category": "launchers",
"category": "launcher",
"input": "walker.css",
"outputs": [
{
@@ -128,7 +128,7 @@ Singleton {
{
"id": "pywalfox",
"name": "Pywalfox",
"category": "applications",
"category": "browser",
"input": "pywalfox.json",
"outputs": [
{
@@ -141,7 +141,7 @@ Singleton {
{
"id": "discord",
"name": "Discord",
"category": "applications",
"category": "misc",
"input": "vesktop.css",
"clients": [
{
@@ -189,7 +189,7 @@ Singleton {
{
"id": "code",
"name": "VSCode",
"category": "applications",
"category": "editor",
"input": "code.json",
"clients": [
{
@@ -205,7 +205,7 @@ Singleton {
{
"id": "zed",
"name": "Zed",
"category": "applications",
"category": "editor",
"input": "zed.json",
"outputs": [
{
@@ -217,7 +217,7 @@ Singleton {
{
"id": "helix",
"name": "Helix",
"category": "applications",
"category": "editor",
"input": "helix.toml",
"outputs": [
{
@@ -228,7 +228,7 @@ Singleton {
{
"id": "spicetify",
"name": "Spicetify",
"category": "applications",
"category": "audio",
"input": "spicetify.ini",
"outputs": [
{
@@ -240,7 +240,7 @@ Singleton {
{
"id": "telegram",
"name": "Telegram",
"category": "applications",
"category": "misc",
"input": "telegram.tdesktop-theme",
"outputs": [
{
@@ -251,7 +251,7 @@ Singleton {
{
"id": "zenBrowser",
"name": "Zen Browser",
"category": "applications",
"category": "browser",
"input": "zen-browser/zen-userChrome.css",
"outputs": [
{
@@ -268,7 +268,7 @@ Singleton {
{
"id": "cava",
"name": "Cava",
"category": "applications",
"category": "audio",
"input": "cava.ini",
"outputs": [
{
@@ -280,7 +280,7 @@ Singleton {
{
"id": "yazi",
"name": "Yazi",
"category": "applications",
"category": "misc",
"input": "yazi.toml",
"outputs": [
{
@@ -291,7 +291,7 @@ Singleton {
{
"id": "emacs",
"name": "Emacs",
"category": "applications",
"category": "editor",
"input": "emacs.el",
"outputs": [
{
@@ -306,7 +306,7 @@ Singleton {
{
"id": "niri",
"name": "Niri",
"category": "compositors",
"category": "compositor",
"input": "niri.kdl",
"outputs": [
{
@@ -318,7 +318,7 @@ Singleton {
{
"id": "hyprland",
"name": "Hyprland",
"category": "compositors",
"category": "compositor",
"input": "hyprland.conf",
"outputs": [
{
@@ -330,7 +330,7 @@ Singleton {
{
"id": "mango",
"name": "Mango",
"category": "compositors",
"category": "compositor",
"input": "mango.conf",
"outputs": [
{