add quickshell bar

This commit is contained in:
Johannes Knopp
2026-04-06 01:30:28 +02:00
parent 8d95eeb892
commit c2b28df404
15 changed files with 1043 additions and 0 deletions

View File

@ -0,0 +1,84 @@
import Quickshell
import QtQuick
import "../components"
PanelWindow {
id: root
property var modelData
screen: modelData
anchors {
top: true
left: true
right: true
}
implicitHeight: 40
color: Theme.bg
readonly property string screenName: modelData.name
// Layout — three sections anchored independently for true centering
Item {
anchors.fill: parent
anchors.leftMargin: 8
anchors.rightMargin: 8
anchors.topMargin: 2
anchors.bottomMargin: 2
// Left
Enclosure {
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
child: Workspaces {
screenName: root.screenName
}
}
// Center — truly centered regardless of left/right content width
Enclosure {
anchors.centerIn: parent
child: MusicPlayer {
id: musicChip
onClicked: musicControls.visible = !musicControls.visible
}
}
// Right — status chips
Enclosure {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
child: Row {
spacing: 8
SysTray {
anchors.verticalCenter: parent.verticalCenter
barWindow: root
}
NetworkStatus {
anchors.verticalCenter: parent.verticalCenter
}
VolumeControl {
anchors.verticalCenter: parent.verticalCenter
}
Clock {
anchors.verticalCenter: parent.verticalCenter
}
}
}
}
// Popup declared after the layout so musicChip is already initialised.
// Centered horizontally within the bar window, placed just below it.
MusicPlayerControls {
id: musicControls
visible: false
anchor.window: root
anchor.rect.x: Math.round((root.width - musicControls.width) / 2)
anchor.rect.y: root.height
player: musicChip.player
}
}