From 8130cb1bdd6b2a6bb45db2f7a2f7500725118af5 Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Sat, 6 Sep 2025 22:47:36 -0400 Subject: [PATCH 1/4] annoying --- modules/bar/components/Caffeine.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/bar/components/Caffeine.qml b/modules/bar/components/Caffeine.qml index 126ec7a..e45cb45 100644 --- a/modules/bar/components/Caffeine.qml +++ b/modules/bar/components/Caffeine.qml @@ -6,7 +6,7 @@ StyledIconButton { id: root border.width: 2 - border.color: Caffeine.enabled ? Styling.theme.secondary : root.hovered ? Styling.theme.primary : Styling.theme.base300 + border.color: Caffeine.enabled ? Styling.theme.secondary : root.hovered ? Styling.theme.primary : Styling.theme.base200 text: Styling.lucide.icons.coffee onClicked: { From 96d8ab6534c6ac33a069d26b089a085a215aec55 Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Sat, 6 Sep 2025 22:59:02 -0400 Subject: [PATCH 2/4] reorg bar --- components/StyledLayoutSeparator.qml | 12 +++++ modules/bar/Bar.qml | 24 +++++---- modules/bar/components/Clock.qml | 12 ++--- modules/bar/components/Memory.qml | 21 ++++---- modules/bar/components/Network.qml | 79 +++++++++++++--------------- modules/bar/components/Storage.qml | 23 ++++---- 6 files changed, 89 insertions(+), 82 deletions(-) create mode 100644 components/StyledLayoutSeparator.qml diff --git a/components/StyledLayoutSeparator.qml b/components/StyledLayoutSeparator.qml new file mode 100644 index 0000000..e5b0295 --- /dev/null +++ b/components/StyledLayoutSeparator.qml @@ -0,0 +1,12 @@ +import qs.config +import QtQuick +import QtQuick.Layouts + +Rectangle { + color: Styling.theme.basecontent + opacity: 0.33 + Layout.fillHeight: true + Layout.margins: 2 + implicitWidth: 0.5 + radius: 9999 +} diff --git a/modules/bar/Bar.qml b/modules/bar/Bar.qml index 37d8226..afa5947 100644 --- a/modules/bar/Bar.qml +++ b/modules/bar/Bar.qml @@ -28,7 +28,7 @@ StyledWrapperRectangle { RowLayout { id: leftbar - spacing: Styling.layout.spacing.base + spacing: Styling.layout.spacing.lg SystemLogo { implicitSize: 22 @@ -44,7 +44,7 @@ StyledWrapperRectangle { Layout.alignment: Qt.AlignHCenter - spacing: Styling.layout.spacing.base + spacing: Styling.layout.spacing.lg Mpris {} } @@ -54,18 +54,14 @@ StyledWrapperRectangle { Layout.alignment: Qt.AlignRight - spacing: Styling.layout.spacing.base - - Pywal {} + spacing: Styling.layout.spacing.lg Pipewire {} - Caffeine {} + StyledLayoutSeparator {} Network {} - Bluetooth {} - Storage {} Memory {} @@ -74,10 +70,20 @@ StyledWrapperRectangle { Gpu {} - Power {} + StyledLayoutSeparator {} + + Pywal {} + + Caffeine {} + + Bluetooth {} + + StyledLayoutSeparator {} Clock {} + Power {} + Notifications {} } } 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()}%` } } From fdcaa77581f93efb9bedc49d89990d60ede50708 Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Sun, 7 Sep 2025 09:23:51 -0400 Subject: [PATCH 3/4] remove scuffed popup handling --- components/StyledPopupWindow.qml | 113 +++++++++++++++---------------- services/Visibility.qml | 10 --- 2 files changed, 54 insertions(+), 69 deletions(-) diff --git a/components/StyledPopupWindow.qml b/components/StyledPopupWindow.qml index 4927cfb..44e5553 100644 --- a/components/StyledPopupWindow.qml +++ b/components/StyledPopupWindow.qml @@ -1,6 +1,6 @@ -import qs.services import QtQuick import Quickshell +import Quickshell.Hyprland import Quickshell.Widgets PopupWindow { @@ -16,87 +16,82 @@ PopupWindow { color: "transparent" function toggle() { - Visibility.togglePopup(this); + root.state = root.state == "opened" ? "closed" : "opened"; + } + + HyprlandFocusGrab { + id: grab + active: root.visible + windows: [root] + onCleared: { + root.state = "closed"; + } } implicitWidth: background.width - Behavior on implicitWidth { - NumberAnimation { - duration: 100 - } - } implicitHeight: background.height - Behavior on implicitHeight { - NumberAnimation { - duration: 100 - } - } - Timer { - id: timer - interval: 750 - onTriggered: { - if (!root.visible) { - return; + WrapperRectangle { + id: background + + focus: true + onFocusChanged: { + if (!focus) { + grab.active = false; } - root.toggle(); } - } - WrapperMouseArea { - hoverEnabled: true - onExited: { - timer.start(); + Behavior on opacity { + NumberAnimation { + duration: root.animationDuration + } } - onEntered: { - timer.stop(); - } - WrapperRectangle { - id: background - opacity: 0 - Behavior on opacity { - NumberAnimation { - duration: root.animationDuration + state: "closed" + states: [ + State { + name: "closed" + PropertyChanges { + background { + opacity: 0 + } } - } - - states: State { + }, + State { name: "opened" - when: root.opened PropertyChanges { background { opacity: 1 } } } + ] - transitions: [ - Transition { - from: "" - to: "opened" - ScriptAction { - script: root.visible = true + transitions: [ + Transition { + from: "closed" + to: "opened" + ScriptAction { + script: root.visible = true + } + }, + Transition { + from: "opened" + to: "closed" + SequentialAnimation { + PauseAnimation { + duration: root.animationDuration } - }, - Transition { - from: "opened" - to: "" - SequentialAnimation { - PauseAnimation { - duration: root.animationDuration - } - ScriptAction { - script: root.visible = false - } + ScriptAction { + script: root.visible = false } } - ] - - Loader { - active: root.visible - sourceComponent: root.content } + ] + + Loader { + active: root.visible + sourceComponent: root.content } } } diff --git a/services/Visibility.qml b/services/Visibility.qml index 57cf887..d3ea806 100644 --- a/services/Visibility.qml +++ b/services/Visibility.qml @@ -1,6 +1,5 @@ pragma Singleton -import qs.components import Quickshell Singleton { @@ -9,15 +8,6 @@ Singleton { property alias pomodoro: properties.pomodoro property alias powermenu: properties.powermenu property alias storybook: properties.storybook - property StyledPopupWindow activePopup - - function togglePopup(popup: StyledPopupWindow) { - if (activePopup && popup != activePopup) { - activePopup.state = ""; - } - popup.state = popup.state == "opened" ? "" : "opened"; - activePopup = popup; - } PersistentProperties { id: properties From 112ed0d6de08dfde12f1eeac437bfa943ac1aa7e Mon Sep 17 00:00:00 2001 From: Benjamin Palko Date: Sun, 7 Sep 2025 09:31:19 -0400 Subject: [PATCH 4/4] simplify StyledPopupWindow --- components/StyledPopupWindow.qml | 27 ++++++++----------- .../components/bluetooth/BluetoothMenu.qml | 5 ---- .../notifications/NotificationMenu.qml | 4 --- modules/bar/components/tray/menu/Menu.qml | 4 --- 4 files changed, 11 insertions(+), 29 deletions(-) diff --git a/components/StyledPopupWindow.qml b/components/StyledPopupWindow.qml index 44e5553..cf87fb1 100644 --- a/components/StyledPopupWindow.qml +++ b/components/StyledPopupWindow.qml @@ -1,39 +1,34 @@ +import qs.config import QtQuick import Quickshell import Quickshell.Hyprland -import Quickshell.Widgets PopupWindow { id: root - property bool opened: false - property int animationDuration: 200 - property alias margins: background.margin - property alias backgroundColor: background.color - property alias radius: background.radius - property alias state: background.state + required property Component content + implicitWidth: background.width + implicitHeight: background.height color: "transparent" - function toggle() { - root.state = root.state == "opened" ? "closed" : "opened"; - } - HyprlandFocusGrab { id: grab active: root.visible windows: [root] onCleared: { - root.state = "closed"; + background.state = "closed"; } } - implicitWidth: background.width - implicitHeight: background.height + function toggle() { + background.state = background.state == "opened" ? "closed" : "opened"; + } - WrapperRectangle { + StyledWrapperRectangle { id: background + margin: 16 focus: true onFocusChanged: { if (!focus) { @@ -43,7 +38,7 @@ PopupWindow { Behavior on opacity { NumberAnimation { - duration: root.animationDuration + duration: Styling.animations.speed.normal } } diff --git a/modules/bar/components/bluetooth/BluetoothMenu.qml b/modules/bar/components/bluetooth/BluetoothMenu.qml index b9bc688..7e953cf 100644 --- a/modules/bar/components/bluetooth/BluetoothMenu.qml +++ b/modules/bar/components/bluetooth/BluetoothMenu.qml @@ -1,7 +1,6 @@ pragma ComponentBehavior: Bound import qs.components -import qs.config import QtQuick import QtQuick.Layouts import Quickshell @@ -10,10 +9,6 @@ import Quickshell.Bluetooth StyledPopupWindow { id: root - backgroundColor: Styling.theme.base300 - margins: 16 - radius: 8 - content: ColumnLayout { spacing: 8 StyledWrapperRectangle { diff --git a/modules/bar/components/notifications/NotificationMenu.qml b/modules/bar/components/notifications/NotificationMenu.qml index 877f30f..d608fd8 100644 --- a/modules/bar/components/notifications/NotificationMenu.qml +++ b/modules/bar/components/notifications/NotificationMenu.qml @@ -9,10 +9,6 @@ import QtQuick.Layouts StyledPopupWindow { id: root - backgroundColor: Styling.theme.base300 - margins: 16 - radius: 8 - content: GridLayout { columns: 2 diff --git a/modules/bar/components/tray/menu/Menu.qml b/modules/bar/components/tray/menu/Menu.qml index 43ce6b5..db54cfc 100644 --- a/modules/bar/components/tray/menu/Menu.qml +++ b/modules/bar/components/tray/menu/Menu.qml @@ -9,10 +9,6 @@ import Quickshell StyledPopupWindow { id: window - backgroundColor: Styling.theme.base300 - margins: 14 - radius: 8 - property QsMenuOpener menuOpener content: ColumnLayout {