Compare commits

...

3 commits

Author SHA1 Message Date
Damocles
d92a46035d restore niri specifics, gracefully fail 2026-04-10 23:32:47 +02:00
Damocles
61051b7b7b fix layer 2026-04-10 23:22:22 +02:00
Damocles
b69e7e5c01 fix elements overflowing 2026-04-10 23:16:41 +02:00
3 changed files with 69 additions and 34 deletions

View file

@ -10,6 +10,7 @@ PanelWindow {
required property var screen
color: "transparent"
layer: WlrLayer.Bottom
anchors {
top: true
@ -33,39 +34,31 @@ PanelWindow {
spacing: 0
// ---- left ----
Item {
Layout.fillWidth: true
Layout.fillHeight: true
RowLayout {
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
Layout.fillWidth: true
spacing: 8
// M.Workspaces {}
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 {
Layout.fillWidth: true
Layout.fillHeight: true
RowLayout {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
Layout.fillWidth: true
spacing: 12
Item { Layout.fillWidth: true }
M.Mpris {}
M.Volume {}
M.Bluetooth {}
@ -83,4 +76,3 @@ PanelWindow {
}
}
}
}

View file

@ -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 = "";
}
}
}

View file

@ -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)])
}
}
}
}