From 608854ba03932e7e79e45707509422a637d3deb1 Mon Sep 17 00:00:00 2001 From: Kiana Sheibani Date: Fri, 12 Dec 2025 14:39:47 -0500 Subject: [PATCH] feat: hidden mode --- modules/Commands.qml | 20 ++++++++++++++++++++ modules/ui/Exclusion.qml | 6 ++++-- modules/ui/UI.qml | 14 ++++++++++++-- modules/ui/UIState.qml | 2 ++ 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/modules/Commands.qml b/modules/Commands.qml index b58e020..ba56ed9 100644 --- a/modules/Commands.qml +++ b/modules/Commands.qml @@ -123,6 +123,26 @@ Scope { } } + CustomShortcut { + name: "hidden" + description: "Enable hidden mode" + onPressed: { + States.screens.forEach((uiState, _, _) => { + uiState.hidden = true; + }) + } + } + + CustomShortcut { + name: "hiddenoff" + description: "Disable hidden mode" + onPressed: { + States.screens.forEach((uiState, _, _) => { + uiState.hidden = false; + }) + } + } + CustomShortcut { name: "session" description: "Toggle session menu" diff --git a/modules/ui/Exclusion.qml b/modules/ui/Exclusion.qml index 8d6caef..5f980e4 100644 --- a/modules/ui/Exclusion.qml +++ b/modules/ui/Exclusion.qml @@ -9,6 +9,7 @@ Scope { id: root required property ShellScreen screen + property bool enabled: true ExclusionZone { anchors.left: true @@ -16,7 +17,7 @@ Scope { ExclusionZone { anchors.top: true - exclusiveZone: Config.bar.height + exclusiveZone: root.enabled ? Config.bar.height : undefined } ExclusionZone { @@ -30,7 +31,8 @@ Scope { component ExclusionZone: CustomWindow { screen: root.screen name: "border-exclusion" - exclusiveZone: Config.border.thickness + exclusionMode: root.enabled ? ExclusionMode.Normal : ExclusionMode.Ignore + exclusiveZone: root.enabled ? Config.border.thickness : undefined mask: Region {} } } diff --git a/modules/ui/UI.qml b/modules/ui/UI.qml index cb7ee66..896cdc4 100644 --- a/modules/ui/UI.qml +++ b/modules/ui/UI.qml @@ -14,6 +14,7 @@ Variants { Exclusion { screen: scope.modelData + enabled: !uiState.uiState.hidden } CustomWindow { @@ -37,9 +38,13 @@ Variants { // Exclusion exclusionMode: ExclusionMode.Ignore - mask: uiState.uiState.blockScreen ? exclusionBlock : exclusion + mask: uiState.uiState.hidden ? exclusionHidden : uiState.uiState.blockScreen ? exclusionBlock : exclusion WlrLayershell.keyboardFocus: uiState.uiState.blockScreen ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None + Region { + id: exclusionHidden + } + Region { id: exclusionBlock intersection: Intersection.Xor @@ -78,7 +83,7 @@ Variants { anchors.fill: parent color: Config.colors.overlay opacity: uiState.uiState.blockScreen ? 0.5 : 0 - visible: opacity > 0 + visible: !uiState.uiState.hidden && opacity > 0 Behavior on opacity { Anim {} @@ -90,6 +95,7 @@ Variants { blurMax: 25 blurMultiplier: 0 glowColor: Config.colors.highlight + visible: !uiState.uiState.hidden } Interactions { @@ -97,10 +103,12 @@ Variants { bar: bar panels: panels screen: scope.modelData + visible: !uiState.uiState.hidden Panels { id: panels + visible: !uiState.uiState.hidden uiState: uiState.uiState screen: scope.modelData bar: bar @@ -109,11 +117,13 @@ Variants { Border { id: border + visible: !uiState.uiState.hidden } Bar { id: bar + visible: !uiState.uiState.hidden uiState: uiState.uiState screen: scope.modelData popouts: panels.popouts diff --git a/modules/ui/UIState.qml b/modules/ui/UIState.qml index 39307f8..b0ae204 100644 --- a/modules/ui/UIState.qml +++ b/modules/ui/UIState.qml @@ -24,6 +24,8 @@ Scope { property bool osd property bool session + // Special modes + property bool hidden property bool blockScreen // Other state