Synchronize picker with host panel state
This commit is contained in:
@@ -14,6 +14,10 @@ import "Classify.js" as Classify
|
|||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
|
// Injected by the Omarchy plugin host. Following its shared panel-open state
|
||||||
|
// keeps the mapped window and the host's callable Loader in sync even after
|
||||||
|
// plugin rescans temporarily leave more than one Loader instance alive.
|
||||||
|
property var shell: null
|
||||||
property bool opened: false
|
property bool opened: false
|
||||||
property string filterText: ""
|
property string filterText: ""
|
||||||
property string typeFilter: "" // chip filter, "" = all; combined into the query
|
property string typeFilter: "" // chip filter, "" = all; combined into the query
|
||||||
@@ -92,6 +96,20 @@ Item {
|
|||||||
else root.open()
|
else root.open()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function syncShellOpenState() {
|
||||||
|
if (!root.shell || !root.shell.openPanelIds) return
|
||||||
|
var shouldOpen = root.shell.openPanelIds["alanfortlink.clipboard"] === true
|
||||||
|
if (shouldOpen && !root.opened) root.open()
|
||||||
|
else if (!shouldOpen && root.opened) root.close()
|
||||||
|
}
|
||||||
|
|
||||||
|
onShellChanged: root.syncShellOpenState()
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: root.shell
|
||||||
|
function onOpenPanelIdsChanged() { root.syncShellOpenState() }
|
||||||
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------ pause
|
// ------------------------------------------------------------ pause
|
||||||
// Toggle via IPC: omarchy-shell shell call alanfortlink.clipboard pause '{"paused":true}'
|
// Toggle via IPC: omarchy-shell shell call alanfortlink.clipboard pause '{"paused":true}'
|
||||||
// (or {"paused":false}, or {"paused":"toggle"}), and Ctrl+Space in the picker.
|
// (or {"paused":false}, or {"paused":"toggle"}), and Ctrl+Space in the picker.
|
||||||
|
|||||||
+1
-1
@@ -2,7 +2,7 @@
|
|||||||
"schemaVersion": 1,
|
"schemaVersion": 1,
|
||||||
"id": "alanfortlink.clipboard",
|
"id": "alanfortlink.clipboard",
|
||||||
"name": "Clipboard History",
|
"name": "Clipboard History",
|
||||||
"version": "1.0.3",
|
"version": "1.0.4",
|
||||||
"author": "alanfortlink",
|
"author": "alanfortlink",
|
||||||
"description": "Raycast-style clipboard history: fuzzy search over content, type, app and date, with rich per-type previews",
|
"description": "Raycast-style clipboard history: fuzzy search over content, type, app and date, with rich per-type previews",
|
||||||
"kinds": [
|
"kinds": [
|
||||||
|
|||||||
Reference in New Issue
Block a user