core: shell state manager

This commit is contained in:
2026-01-23 23:45:38 +02:00
parent edb941fe90
commit 31ea8d7616
2 changed files with 58 additions and 4 deletions

View File

@@ -5,7 +5,9 @@ import "Shell"
ShellRoot {
id: baseShell
property bool isOpen: false
// Use the singleton directly; it controls the shell state globally.
property bool isOpen: ShellStateManager.shellOpen
WLRLayerTopbar {
visible: baseShell.isOpen
@@ -20,7 +22,7 @@ ShellRoot {
triggerDescription: "Toggle the menu"
name: "shell_toggle"
onReleased: {
baseShell.isOpen = !baseShell.isOpen;
ShellStateManager.toggleShell()
}
}
@@ -28,10 +30,10 @@ ShellRoot {
target: "deltarune.shell"
enabled: true
function open(): void {
baseShell.isOpen = true;
ShellStateManager.openShell()
}
function close(): void {
baseShell.isOpen = false;
ShellStateManager.closeShell()
}
}
}