From b7e3b5d88722870abe8bf56cca5f7a6e9eaf6dc8 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Sat, 10 May 2025 10:55:59 +0200 Subject: [PATCH] bar: allow hiding bg --- .config/quickshell/modules/bar/Bar.qml | 9 +++++---- .config/quickshell/modules/common/ConfigOptions.qml | 1 + 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.config/quickshell/modules/bar/Bar.qml b/.config/quickshell/modules/bar/Bar.qml index 7975b1173..44f18e335 100644 --- a/.config/quickshell/modules/bar/Bar.qml +++ b/.config/quickshell/modules/bar/Bar.qml @@ -18,6 +18,7 @@ Scope { readonly property int barHeight: Appearance.sizes.barHeight readonly property int barCenterSideModuleWidth: Appearance.sizes.barCenterSideModuleWidth readonly property int osdHideMouseMoveThreshold: 20 + property bool showBarBackground: ConfigOptions.bar.showBackground Variants { // For each monitor model: Quickshell.screens @@ -30,7 +31,7 @@ Scope { screen: modelData WlrLayershell.namespace: "quickshell:bar" height: barHeight + Appearance.rounding.screenRounding - exclusiveZone: barHeight + exclusiveZone: showBarBackground ? barHeight : (barHeight - 4) mask: Region { item: barContent } @@ -47,7 +48,7 @@ Scope { anchors.right: parent.right anchors.left: parent.left anchors.top: parent.top - color: Appearance.colors.colLayer0 + color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" height: barHeight RowLayout { // Left section @@ -324,14 +325,14 @@ Scope { anchors.left: parent.left size: Appearance.rounding.screenRounding corner: cornerEnum.topLeft - color: Appearance.colors.colLayer0 + color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" } RoundCorner { anchors.top: parent.top anchors.right: parent.right size: Appearance.rounding.screenRounding corner: cornerEnum.topRight - color: Appearance.colors.colLayer0 + color: showBarBackground ? Appearance.colors.colLayer0 : "transparent" } } diff --git a/.config/quickshell/modules/common/ConfigOptions.qml b/.config/quickshell/modules/common/ConfigOptions.qml index c34b07e7e..c0d6758bd 100644 --- a/.config/quickshell/modules/common/ConfigOptions.qml +++ b/.config/quickshell/modules/common/ConfigOptions.qml @@ -24,6 +24,7 @@ Singleton { property QtObject bar: QtObject { property int batteryLowThreshold: 20 property string topLeftIcon: "spark" // Options: distro, spark + property bool showBackground: true property QtObject resources: QtObject { property bool alwaysShowSwap: true property bool alwaysShowCpu: false