feat(launcher): Add toggle for clip plugin preview

This commit is contained in:
loner
2025-11-19 05:56:54 +08:00
parent 529869f796
commit ed373df99d
5 changed files with 14 additions and 1 deletions
+4
View File
@@ -1341,6 +1341,10 @@
"description": "Access previously copied items from the launcher.",
"label": "Enable clipboard history"
},
"clip-preview": {
"description": "Show a preview of the clipboard content when using the >clip command.",
"label": "Enable clip preview"
},
"custom-launch-prefix": {
"description": "Prefix commands with a custom launcher (e.g., 'runapp' for systemd integration).",
"label": "Custom launch prefix"
+1
View File
@@ -139,6 +139,7 @@
},
"appLauncher": {
"enableClipboardHistory": false,
"enableClipPreview": true,
"position": "center",
"pinnedExecs": [],
"useApp2Unit": false,
+1
View File
@@ -295,6 +295,7 @@ Singleton {
// applauncher
property JsonObject appLauncher: JsonObject {
property bool enableClipboardHistory: false
property bool enableClipPreview: true
// Position: center, top_left, top_right, bottom_left, bottom_right, bottom_center, top_center
property string position: "center"
property list<string> pinnedExecs: []
+1 -1
View File
@@ -13,7 +13,7 @@ import qs.Widgets
SmartPanel {
id: root
readonly property bool previewActive: searchText.startsWith(">clip")
readonly property bool previewActive: searchText.startsWith(">clip") && Settings.data.appLauncher.enableClipPreview
// Panel configuration
readonly property int listPanelWidth: Math.round(600 * Style.uiScaleRatio)
@@ -65,6 +65,13 @@ ColumnLayout {
onToggled: checked => Settings.data.appLauncher.enableClipboardHistory = checked
}
NToggle {
label: I18n.tr("settings.launcher.settings.clip-preview.label")
description: I18n.tr("settings.launcher.settings.clip-preview.description")
checked: Settings.data.appLauncher.enableClipPreview
onToggled: checked => Settings.data.appLauncher.enableClipPreview = checked
}
NToggle {
label: I18n.tr("settings.launcher.settings.sort-by-usage.label")
description: I18n.tr("settings.launcher.settings.sort-by-usage.description")