From 351fb82ac7e93805b9fa80cfe28411036f6ed68f Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Sun, 7 Sep 2025 12:21:33 -0400 Subject: [PATCH] use wrapper rect --- components/StyledRectangle.qml | 7 +- components/StyledWrapperRectangle.qml | 1 + modules/bar/Bar.qml | 1 + modules/bar/components/Clock.qml | 12 ++- modules/bar/components/Memory.qml | 21 +++-- modules/bar/components/Network.qml | 79 +++++++++---------- modules/bar/components/Storage.qml | 23 +++--- .../components/bluetooth/AvailableDevice.qml | 5 +- .../components/bluetooth/ConnectedDevice.qml | 4 +- .../bar/components/bluetooth/PairedDevice.qml | 5 +- .../notifications/NotificationItem.qml | 4 +- .../notifications/NotificationMenu.qml | 4 +- 12 files changed, 75 insertions(+), 91 deletions(-) diff --git a/components/StyledRectangle.qml b/components/StyledRectangle.qml index 3682786..aefab71 100644 --- a/components/StyledRectangle.qml +++ b/components/StyledRectangle.qml @@ -1,12 +1,9 @@ import qs.config import QtQuick -import Quickshell.Widgets -WrapperRectangle { - id: root - margin: 8 +Rectangle { radius: Styling.theme.radiusBox - color: Styling.theme.base200 + color: Styling.theme.base100 Behavior on color { ColorAnimation { duration: Styling.animations.speed.normal diff --git a/components/StyledWrapperRectangle.qml b/components/StyledWrapperRectangle.qml index f2453d0..1a89fa8 100644 --- a/components/StyledWrapperRectangle.qml +++ b/components/StyledWrapperRectangle.qml @@ -3,6 +3,7 @@ import QtQuick import Quickshell.Widgets WrapperRectangle { + margin: 8 radius: Styling.theme.radiusBox color: Styling.theme.base100 Behavior on color { diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index 37d8226..bbbc6ec 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -22,6 +22,7 @@ StyledWrapperRectangle { border.color: Styling.theme.base200 margin: 4 + color: Styling.theme.base100 RowLayout { diff --git a/modules/bar/components/Clock.qml b/modules/bar/components/Clock.qml index 3ddb5a7..1941417 100644 --- a/modules/bar/components/Clock.qml +++ b/modules/bar/components/Clock.qml @@ -1,12 +1,10 @@ import qs.components import Quickshell -StyledRectangle { - StyledText { - text: ` ${Qt.formatDateTime(clock.date, "hh:mm:ss AP")}` - SystemClock { - id: clock - precision: SystemClock.Seconds - } +StyledText { + text: ` ${Qt.formatDateTime(clock.date, "hh:mm:ss AP")}` + SystemClock { + id: clock + precision: SystemClock.Seconds } } diff --git a/modules/bar/components/Memory.qml b/modules/bar/components/Memory.qml index 55f90df..deafda7 100644 --- a/modules/bar/components/Memory.qml +++ b/modules/bar/components/Memory.qml @@ -5,20 +5,17 @@ import qs.utils import QtQuick import QtQuick.Layouts -StyledRectangle { +RowLayout { - RowLayout { + Ref { + service: SystemInfo + } - Ref { - service: SystemInfo - } + LucideIcon { + text: Styling.lucide.icons.memoryStick + } - LucideIcon { - text: Styling.lucide.icons.memoryStick - } - - StyledText { - text: ` ${(SystemInfo.memPerc * 100).toFixed()}%` - } + StyledText { + text: ` ${(SystemInfo.memPerc * 100).toFixed()}%` } } diff --git a/modules/bar/components/Network.qml b/modules/bar/components/Network.qml index 57a0905..7b65d2c 100644 --- a/modules/bar/components/Network.qml +++ b/modules/bar/components/Network.qml @@ -5,51 +5,48 @@ import qs.utils import QtQuick import QtQuick.Layouts -StyledRectangle { +RowLayout { - RowLayout { + Ref { + service: NetworkService + } - Ref { - service: NetworkService - } - - LucideIcon { - id: icon - text: Styling.lucide.icons.wifiOff - states: [ - State { - name: "high" - when: NetworkService.active?.strength > 50 - PropertyChanges { - icon { - text: Styling.lucide.icons.wifi - } - } - }, - State { - name: "medium" - when: NetworkService.active?.strength > 25 - PropertyChanges { - icon { - text: Styling.lucide.icons.wifiHigh - } - } - }, - State { - name: "low" - when: NetworkService.active?.strength > 0 - PropertyChanges { - icon { - text: Styling.lucide.icons.wifiLow - } + LucideIcon { + id: icon + text: Styling.lucide.icons.wifiOff + states: [ + State { + name: "high" + when: NetworkService.active?.strength > 50 + PropertyChanges { + icon { + text: Styling.lucide.icons.wifi } } - ] - } + }, + State { + name: "medium" + when: NetworkService.active?.strength > 25 + PropertyChanges { + icon { + text: Styling.lucide.icons.wifiHigh + } + } + }, + State { + name: "low" + when: NetworkService.active?.strength > 0 + PropertyChanges { + icon { + text: Styling.lucide.icons.wifiLow + } + } + } + ] + } - StyledText { - id: text - text: ` ${(NetworkService.active?.strength ?? 0).toFixed()}%` - } + StyledText { + id: text + text: ` ${(NetworkService.active?.strength ?? 0).toFixed()}%` } } diff --git a/modules/bar/components/Storage.qml b/modules/bar/components/Storage.qml index 0a1d2b7..7450969 100644 --- a/modules/bar/components/Storage.qml +++ b/modules/bar/components/Storage.qml @@ -5,22 +5,19 @@ import qs.utils import QtQuick import QtQuick.Layouts -StyledRectangle { +RowLayout { - RowLayout { + Ref { + service: SystemInfo + } - Ref { - service: SystemInfo - } + LucideIcon { + text: Styling.lucide.icons.hardDrive + } - LucideIcon { - text: Styling.lucide.icons.hardDrive - } + StyledText { + id: text - StyledText { - id: text - - text: ` ${(SystemInfo.storagePerc * 100).toFixed()}%` - } + text: ` ${(SystemInfo.storagePerc * 100).toFixed()}%` } } diff --git a/modules/bar/components/bluetooth/AvailableDevice.qml b/modules/bar/components/bluetooth/AvailableDevice.qml index 62a65f5..9196210 100644 --- a/modules/bar/components/bluetooth/AvailableDevice.qml +++ b/modules/bar/components/bluetooth/AvailableDevice.qml @@ -1,20 +1,21 @@ pragma ComponentBehavior: Bound import qs.components +import qs.config import QtQuick import QtQuick.Layouts import Quickshell import Quickshell.Bluetooth import Quickshell.Widgets -StyledRectangle { +StyledWrapperRectangle { id: root required property BluetoothDevice modelData RowLayout { id: row - spacing: 8 + spacing: Styling.layout.spacing.base Loader { active: root.modelData?.icon != undefined diff --git a/modules/bar/components/bluetooth/ConnectedDevice.qml b/modules/bar/components/bluetooth/ConnectedDevice.qml index 2b6f079..960acf9 100644 --- a/modules/bar/components/bluetooth/ConnectedDevice.qml +++ b/modules/bar/components/bluetooth/ConnectedDevice.qml @@ -8,14 +8,14 @@ import Quickshell import Quickshell.Bluetooth import Quickshell.Widgets -StyledRectangle { +StyledWrapperRectangle { id: root required property BluetoothDevice modelData RowLayout { id: row - spacing: 8 + spacing: Styling.layout.spacing.base Loader { active: root.modelData?.icon != undefined diff --git a/modules/bar/components/bluetooth/PairedDevice.qml b/modules/bar/components/bluetooth/PairedDevice.qml index 297c63f..f8583b0 100644 --- a/modules/bar/components/bluetooth/PairedDevice.qml +++ b/modules/bar/components/bluetooth/PairedDevice.qml @@ -2,21 +2,20 @@ pragma ComponentBehavior: Bound import qs.components import qs.config -import qs.widgets import QtQuick import QtQuick.Layouts import Quickshell import Quickshell.Bluetooth import Quickshell.Widgets -StyledRectangle { +StyledWrapperRectangle { id: root required property BluetoothDevice modelData RowLayout { id: row - spacing: 8 + spacing: Styling.layout.spacing.base Loader { active: root.modelData?.icon != undefined diff --git a/modules/bar/components/notifications/NotificationItem.qml b/modules/bar/components/notifications/NotificationItem.qml index b2c45fb..21b69f5 100644 --- a/modules/bar/components/notifications/NotificationItem.qml +++ b/modules/bar/components/notifications/NotificationItem.qml @@ -1,18 +1,16 @@ pragma ComponentBehavior: Bound import qs.components -import qs.widgets import QtQuick import QtQuick.Layouts import Quickshell import Quickshell.Widgets -StyledRectangle { +StyledWrapperRectangle { id: root required property var modelData - margin: 16 anchors.left: parent.left anchors.right: parent.right diff --git a/modules/bar/components/notifications/NotificationMenu.qml b/modules/bar/components/notifications/NotificationMenu.qml index d608fd8..43f2f19 100644 --- a/modules/bar/components/notifications/NotificationMenu.qml +++ b/modules/bar/components/notifications/NotificationMenu.qml @@ -1,7 +1,6 @@ pragma ComponentBehavior: Bound import qs.components -import qs.config import qs.services import QtQuick import QtQuick.Layouts @@ -25,9 +24,8 @@ StyledPopupWindow { onClicked: Notifications.clear() } - StyledRectangle { + StyledWrapperRectangle { Layout.columnSpan: 2 - color: Styling.theme.base200 StyledListView { id: notifications