preview works

This commit is contained in:
ari committed 2026-09-23 11:24:58 -04:00
1 parent 2432c43f5f
commit a148aaa30d
5 files changed
+305 -63

No files matched your search

+6 -36
View File
@@ -5,10 +5,7 @@ import Quickshell.Io
ShellRoot {
id: shell
// "", "rename", or "goto".
property string mode: ""
// Set only when Ctrl+G opens the carousel from the rename bar.
property bool gotoReturnsToRename: false
property bool open: false
Compositor {
id: compositor
@@ -23,54 +20,27 @@ ShellRoot {
console.warn("workspace-manager: neither niri nor Hyprland was detected");
}
function openGoto(returnToRename: bool): void {
shell.gotoReturnsToRename = returnToRename;
shell.mode = "goto";
}
function closeAll(): void {
shell.mode = "";
shell.gotoReturnsToRename = false;
shell.open = false;
}
IpcHandler {
target: "workspace"
function toggle(): void {
if (shell.mode === "")
shell.mode = "rename";
else
shell.closeAll();
shell.open = !shell.open;
}
// "goto" is a reserved word, so the IPC name is goTo.
function goTo(): void {
if (shell.mode === "goto")
shell.closeAll();
else
shell.openGoto(false);
shell.open = true;
}
}
RenameBar {
shellOpen: shell.mode === "rename"
compositor: compositor
theme: theme
onRequestClose: shell.closeAll()
onRequestGoto: shell.openGoto(true)
}
GotoView {
shellOpen: shell.mode === "goto"
shellOpen: shell.open
compositor: compositor
theme: theme
onRequestClose: shell.closeAll()
onRequestBack: {
if (shell.gotoReturnsToRename)
shell.mode = "rename";
else
shell.mode = "";
shell.gotoReturnsToRename = false;
}
onRequestBack: shell.closeAll()
}
}