mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-29 06:27:47 -04:00
feat(screenshot): add island snap targets (#3881)
port 2.0
(cherry picked from commit 1e31015acb)
This commit is contained in:
1 parent
36ebe0e3ef
commit
a680e1bd39
2 files changed
+93
No files matched your search
@@ -1,32 +0,0 @@
|
||||
pragma Singleton
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
|
||||
Singleton {
|
||||
property var hosts: ({})
|
||||
|
||||
function key(screenName, barId) {
|
||||
return JSON.stringify([screenName ?? "", barId ?? ""]);
|
||||
}
|
||||
|
||||
function register(key, host) {
|
||||
if (hosts[key] === host)
|
||||
return;
|
||||
const next = Object.assign({}, hosts);
|
||||
next[key] = host;
|
||||
hosts = next;
|
||||
}
|
||||
|
||||
function unregister(key, host) {
|
||||
if (!(key in hosts) || (host && hosts[key] !== host))
|
||||
return;
|
||||
const next = Object.assign({}, hosts);
|
||||
delete next[key];
|
||||
hosts = next;
|
||||
}
|
||||
|
||||
function hostFor(screenName, barId) {
|
||||
return hosts[key(screenName, barId)] ?? null;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user