diff --git a/components/StyledMenu.qml b/components/StyledMenu.qml index 12830d7..24815b6 100644 --- a/components/StyledMenu.qml +++ b/components/StyledMenu.qml @@ -1,5 +1,4 @@ import qs.config -import qs.services import QtQuick import QtQuick.Controls @@ -11,11 +10,6 @@ Menu { focus: true closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutsideParent - popupType: Popup.Window - - function toggle() { - visible ? close() : open(); - } enter: Transition { NumberAnimation { diff --git a/modules/Shell.qml b/modules/Shell.qml index 9971716..41e7643 100644 --- a/modules/Shell.qml +++ b/modules/Shell.qml @@ -4,9 +4,8 @@ import "launcher" import "pomodoro" import "powermenu" import "storybook" -import QtQuick import Quickshell -import Quickshell.Wayland +import QtQuick Variants { model: Quickshell.screens @@ -16,65 +15,7 @@ Variants { required property ShellScreen modelData - PanelWindow { - id: exclusionZone - - anchors.top: true - anchors.left: true - anchors.right: true - - implicitWidth: bar.width - implicitHeight: bar.height - - 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 - } - } - } + Bar {} Launcher {} Pomodoro {} PowerMenu {} diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index 231600b..c39e847 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -3,29 +3,55 @@ 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 -StyledWrapperRectangle { - id: root +PanelWindow { + id: parentWindow - anchors.left: parent.left - anchors.right: parent.right - anchors.top: parent.top - anchors.leftMargin: Dimensions.bar.horizontalMargins - anchors.rightMargin: Dimensions.bar.horizontalMargins - anchors.topMargin: Dimensions.bar.verticalMargins - anchors.bottomMargin: Dimensions.bar.verticalMargins + anchors.top: true + anchors.left: true + anchors.right: true - margin: 6 + implicitHeight: Dimensions.bar.height + color: 'transparent' - RowLayout { + WlrLayershell.layer: WlrLayer.Top + + Item { + + anchors.fill: parent + anchors.leftMargin: Dimensions.bar.horizontalMargins + anchors.rightMargin: Dimensions.bar.horizontalMargins + anchors.topMargin: Dimensions.bar.verticalMargins + anchors.bottomMargin: Dimensions.bar.verticalMargins + + Rectangle { + id: background + anchors.fill: parent + color: Theme.palette.base300 + radius: Dimensions.radius + + border { + color: Theme.palette.base100 + width: Dimensions.bar.border + pixelAligned: true + } + } RowLayout { id: leftbar + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + + anchors.leftMargin: Dimensions.bar.horizontalPadding + anchors.topMargin: Dimensions.bar.verticalPadding + anchors.bottomMargin: Dimensions.bar.verticalPadding + spacing: Dimensions.bar.spacing SystemLogo { @@ -40,7 +66,11 @@ StyledWrapperRectangle { RowLayout { id: centerbar - Layout.alignment: Qt.AlignHCenter + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + + anchors.topMargin: Dimensions.bar.verticalPadding + anchors.bottomMargin: Dimensions.bar.verticalPadding spacing: Dimensions.bar.spacing @@ -50,7 +80,12 @@ StyledWrapperRectangle { RowLayout { id: rightbar - Layout.alignment: Qt.AlignRight + anchors.right: parent.right + anchors.verticalCenter: parent.verticalCenter + + anchors.rightMargin: Dimensions.bar.horizontalPadding + anchors.topMargin: Dimensions.bar.verticalPadding + anchors.bottomMargin: Dimensions.bar.verticalPadding spacing: Dimensions.bar.spacing diff --git a/modules/pomodoro/Pomodoro.qml b/modules/pomodoro/Pomodoro.qml index 9dba513..9d970d8 100644 --- a/modules/pomodoro/Pomodoro.qml +++ b/modules/pomodoro/Pomodoro.qml @@ -55,10 +55,10 @@ StyledWindow { id: circle radius: 150 borderColor: Theme.palette.base100 - strokeColor: PomodoroService.state == "timer" ? Theme.palette.primary : Theme.palette.warning + strokeColor: Pomodoro.state == "timer" ? Theme.palette.primary : Theme.palette.warning strokeWidth: 12 fillColor: button.hovered ? Theme.palette.primary : "transparent" - percentage: (PomodoroService.state == "timer" ? (PomodoroService.initialTime - PomodoroService.remainingTime) : PomodoroService.remainingTime) / PomodoroService.initialTime % 1 + percentage: (Pomodoro.state == "timer" ? (Pomodoro.initialTime - Pomodoro.remainingTime) : Pomodoro.remainingTime) / Pomodoro.initialTime % 1 } StyledIconButton { @@ -69,17 +69,17 @@ StyledWindow { radius: 9999 focus: root.visible - text: PomodoroService.running ? Icons.square : Icons.play + text: Pomodoro.running ? Icons.square : Icons.play font.pixelSize: 48 background: undefined onClicked: { - PomodoroService.toggle(); + Pomodoro.toggle(); } Keys.onSpacePressed: event => { event.accepted = true; - PomodoroService.toggle(); + Pomodoro.toggle(); } Keys.onEscapePressed: event => { event.accepted = true; @@ -87,7 +87,7 @@ StyledWindow { } Keys.onTabPressed: event => { event.accepted = true; - PomodoroService.reset(); + Pomodoro.reset(); } } } @@ -95,7 +95,7 @@ StyledWindow { StyledText { Layout.alignment: Qt.AlignHCenter text: { - const date = new Date(PomodoroService.remainingTime); + const date = new Date(Pomodoro.remainingTime); return `${date.getMinutes().toString().padStart(2, "0")}:${(date.getSeconds() % 3600).toString().padStart(2, "0")}`; } font.pixelSize: 16 @@ -108,7 +108,7 @@ StyledWindow { text: "Reset" onClicked: { - PomodoroService.reset(); + Pomodoro.reset(); } } } diff --git a/services/PomodoroService.qml b/services/Pomodoro.qml similarity index 100% rename from services/PomodoroService.qml rename to services/Pomodoro.qml