From 7022c3a9aefe8925f65002941ed88fc4ebb65f45 Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Sat, 6 Sep 2025 21:53:57 -0400 Subject: [PATCH] move bar to root window --- components/StyledWrapperRectangle.qml | 7 +++ modules/Shell.qml | 63 ++++++++++++++++++++++++++- modules/bar/Bar.qml | 63 +++++++-------------------- 3 files changed, 83 insertions(+), 50 deletions(-) diff --git a/components/StyledWrapperRectangle.qml b/components/StyledWrapperRectangle.qml index 25dd7d5..f2453d0 100644 --- a/components/StyledWrapperRectangle.qml +++ b/components/StyledWrapperRectangle.qml @@ -10,4 +10,11 @@ WrapperRectangle { duration: Styling.animations.speed.fast } } + border.width: 2 + border.color: Styling.theme.base100 + Behavior on border.color { + ColorAnimation { + duration: Styling.animations.speed.fast + } + } } diff --git a/modules/Shell.qml b/modules/Shell.qml index 41e7643..e9fdcc9 100644 --- a/modules/Shell.qml +++ b/modules/Shell.qml @@ -4,8 +4,9 @@ import "launcher" import "pomodoro" import "powermenu" import "storybook" -import Quickshell import QtQuick +import Quickshell +import Quickshell.Wayland Variants { model: Quickshell.screens @@ -15,7 +16,65 @@ Variants { required property ShellScreen modelData - Bar {} + PanelWindow { + id: exclusionZone + + anchors.top: true + anchors.left: true + anchors.right: true + + implicitWidth: bar.width + implicitHeight: bar.height + bar.anchors.margins + + color: "transparent" + } + + PanelWindow { + id: topWindow + + anchors.top: true + anchors.left: true + anchors.right: true + anchors.bottom: true + + color: 'transparent' + + WlrLayershell.exclusionMode: ExclusionMode.Ignore + WlrLayershell.layer: WlrLayer.Top + + mask: Region { + width: topWindow.width + height: topWindow.height + intersection: Intersection.Xor + regions: regions.instances + } + + Variants { + id: regions + + model: panels.children + + Region { + required property Item modelData + + x: modelData.x + y: modelData.y + width: modelData.width + height: modelData.height + intersection: Intersection.Subtract + } + } + + Item { + id: panels + + anchors.fill: parent + + Bar { + id: bar + } + } + } Launcher {} Pomodoro {} PowerMenu {} diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index 98d2aba..37d8226 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -3,55 +3,31 @@ import "components/bluetooth" import "components/hyprland" import "components/notifications" import "components/tray" +import qs.components import qs.config import QtQuick import QtQuick.Layouts -import Quickshell -import Quickshell.Wayland -PanelWindow { - id: parentWindow +StyledWrapperRectangle { + id: root - anchors.top: true - anchors.left: true - anchors.right: true + anchors.left: parent.left + anchors.right: parent.right + anchors.top: parent.top + anchors.margins: 6 + anchors.leftMargin: 10 + anchors.rightMargin: 10 - implicitHeight: 50 - color: 'transparent' + border.width: 3 + border.color: Styling.theme.base200 - WlrLayershell.layer: WlrLayer.Top + margin: 4 - Item { - - anchors.fill: parent - anchors.leftMargin: 8 - anchors.rightMargin: 8 - anchors.topMargin: 4 - anchors.bottomMargin: 4 - - Rectangle { - id: background - anchors.fill: parent - color: Styling.theme.base100 - radius: Styling.theme.radiusBox - - border { - color: Styling.theme.base200 - width: Styling.theme.border - pixelAligned: true - } - } + RowLayout { RowLayout { id: leftbar - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - - anchors.leftMargin: 8 - anchors.topMargin: 4 - anchors.bottomMargin: 4 - spacing: Styling.layout.spacing.base SystemLogo { @@ -66,11 +42,7 @@ PanelWindow { RowLayout { id: centerbar - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - - anchors.topMargin: 4 - anchors.bottomMargin: 4 + Layout.alignment: Qt.AlignHCenter spacing: Styling.layout.spacing.base @@ -80,12 +52,7 @@ PanelWindow { RowLayout { id: rightbar - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - - anchors.rightMargin: 8 - anchors.topMargin: 4 - anchors.bottomMargin: 4 + Layout.alignment: Qt.AlignRight spacing: Styling.layout.spacing.base