quickshell/modules/bar/Bar.qml
2026-07-26 19:45:52 +02:00

88 lines
2.7 KiB
QML

import QtQuick
import QtQuick.Layouts
import Quickshell
import Quickshell.Wayland
import qs
import qs.settings
import qs.modules.wallpaper
Variants {
model: Quickshell.screens
delegate: WlrLayershell {
id: root
required property var modelData
property double moduleHeight: implicitHeight - 10
screen: modelData
anchors {
top: true
left: true
right: true
}
margins {
top: Config.floating ? 10 : 0
left: Config.floating ? 10 : 0
right: Config.floating ? 10 : 0
}
color: 'transparent'
implicitHeight: Config.barHeight
layer: WlrLayer.Top
Rectangle {
id: container
radius: Config.floating ? Config.rounding : 0
color: Qt.rgba(Colors.base00.r, Colors.base00.g, Colors.base00.b, Config.opacity)
anchors.fill: parent
RowLayout {
id: leftLayout
spacing: 10
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: Config.floating ? (Config.barHeight - root.moduleHeight) / 2 : Config.rounding
Ws {
moduleHeight: root.moduleHeight
barScreen: root.modelData
}
ActiveWindow {
moduleHeight: root.moduleHeight
}
}
Item {
id: middleItem
anchors.centerIn: parent
implicitWidth: centerLayout.width
implicitHeight: centerLayout.height
RowLayout {
id: centerLayout
spacing: 5
Clock {
moduleHeight: root.moduleHeight
}
}
}
RowLayout {
id: rightLayout
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
spacing: 5
anchors.rightMargin: Config.floating ? (Config.barHeight - root.moduleHeight) / 2 : Config.rounding
Mpris {
moduleHeight: root.moduleHeight
}
Bat {
moduleHeight: root.moduleHeight
}
Pw {
moduleHeight: root.moduleHeight
}
Tray {
moduleHeight: root.moduleHeight
}
WallpaperPicker {
moduleHeight: root.moduleHeight
screenHeight: root.modelData.height
}
}
}
}
}