From b69e7e5c016ec3dc5322b84bff74b5af0d92c26b Mon Sep 17 00:00:00 2001 From: Damocles Date: Fri, 10 Apr 2026 23:16:41 +0200 Subject: [PATCH 1/3] fix elements overflowing --- modules/Bar.qml | 57 +++++++++++++++++++++---------------------------- 1 file changed, 24 insertions(+), 33 deletions(-) diff --git a/modules/Bar.qml b/modules/Bar.qml index 443e807..b0003c6 100644 --- a/modules/Bar.qml +++ b/modules/Bar.qml @@ -33,54 +33,45 @@ PanelWindow { spacing: 0 // ---- left ---- - Item { + RowLayout { Layout.fillWidth: true - Layout.fillHeight: true + spacing: 8 - RowLayout { - anchors.left: parent.left - anchors.verticalCenter: parent.verticalCenter - spacing: 8 - - // M.Workspaces {} - M.Tray { bar: bar } - M.WindowTitle { Layout.maximumWidth: 400 } - } + // M.Workspaces {} + M.Tray { bar: bar } + M.WindowTitle { Layout.maximumWidth: 400 } + Item { Layout.fillWidth: true } } // ---- center ---- RowLayout { spacing: 8 + Layout.alignment: Qt.AlignVCenter M.Clock {} M.Notifications {} } // ---- right ---- - Item { + RowLayout { Layout.fillWidth: true - Layout.fillHeight: true + spacing: 12 - RowLayout { - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - spacing: 12 - - M.Mpris {} - M.Volume {} - M.Bluetooth {} - M.Backlight {} - M.Network {} - M.PowerProfile {} - M.IdleInhibitor {} - M.Weather {} - M.Temperature {} - M.Cpu {} - M.Memory {} - M.Disk {} - M.Battery {} - M.Wlogout {} - } + Item { Layout.fillWidth: true } + M.Mpris {} + M.Volume {} + M.Bluetooth {} + M.Backlight {} + M.Network {} + M.PowerProfile {} + M.IdleInhibitor {} + M.Weather {} + M.Temperature {} + M.Cpu {} + M.Memory {} + M.Disk {} + M.Battery {} + M.Wlogout {} } } } From 61051b7b7b5ce6efbe50ee04bc24471383b55130 Mon Sep 17 00:00:00 2001 From: Damocles Date: Fri, 10 Apr 2026 23:22:22 +0200 Subject: [PATCH 2/3] fix layer --- modules/Bar.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/Bar.qml b/modules/Bar.qml index b0003c6..e82b2a8 100644 --- a/modules/Bar.qml +++ b/modules/Bar.qml @@ -10,6 +10,7 @@ PanelWindow { required property var screen color: "transparent" + layer: WlrLayer.Bottom anchors { top: true From d92a46035d05843f1acef9eddc63e3be09a3c6dc Mon Sep 17 00:00:00 2001 From: Damocles Date: Fri, 10 Apr 2026 23:32:47 +0200 Subject: [PATCH 3/3] restore niri specifics, gracefully fail --- modules/Bar.qml | 2 +- modules/Workspaces.qml | 9 ++++++++- modules/WorkspacesInner.qml | 36 ++++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 modules/WorkspacesInner.qml diff --git a/modules/Bar.qml b/modules/Bar.qml index e82b2a8..671a453 100644 --- a/modules/Bar.qml +++ b/modules/Bar.qml @@ -38,7 +38,7 @@ PanelWindow { Layout.fillWidth: true spacing: 8 - // M.Workspaces {} + M.Workspaces {} M.Tray { bar: bar } M.WindowTitle { Layout.maximumWidth: 400 } Item { Layout.fillWidth: true } diff --git a/modules/Workspaces.qml b/modules/Workspaces.qml index 5240ce8..97ff721 100644 --- a/modules/Workspaces.qml +++ b/modules/Workspaces.qml @@ -1,7 +1,14 @@ import QtQuick import QtQuick.Layouts -// Niri workspace support disabled — Quickshell.Services.Niri not available RowLayout { spacing: 4 + + Loader { + source: "WorkspacesInner.qml" + onStatusChanged: { + if (status === Loader.Error) + source = ""; + } + } } diff --git a/modules/WorkspacesInner.qml b/modules/WorkspacesInner.qml new file mode 100644 index 0000000..1cc1b12 --- /dev/null +++ b/modules/WorkspacesInner.qml @@ -0,0 +1,36 @@ +import QtQuick +import QtQuick.Layouts +import Quickshell.Services.Niri +import "." as M + +RowLayout { + spacing: 4 + + Repeater { + model: Niri.workspaces + + delegate: Rectangle { + required property var modelData + + implicitWidth: 24 + implicitHeight: 20 + radius: 4 + color: modelData.isFocused + ? M.Theme.base0D + : (modelData.isActive ? M.Theme.base03 : M.Theme.base02) + + Text { + anchors.centerIn: parent + text: modelData.idx ?? modelData.id + color: modelData.isFocused ? M.Theme.base00 : M.Theme.base05 + font.pixelSize: M.Theme.fontSize + font.family: M.Theme.fontFamily + } + + MouseArea { + anchors.fill: parent + onClicked: Niri.dispatch(["action", "focus-workspace", String(modelData.id)]) + } + } + } +}