quickshell/modules/bar/Ws.qml

43 lines
1.2 KiB
QML

pragma ComponentBehavior: Bound
import Quickshell
import Quickshell.Hyprland
import Quickshell.Widgets
import QtQuick
import QtQuick.Layouts
import qs
import qs.widgets
import qs.settings
Rectangle {
id: root
required property ShellScreen barScreen
required property double moduleHeight
property HyprlandMonitor hyprBarScreen: Hyprland.monitorFor(root.barScreen)
radius: Config.rounding
color: Colors.base01
implicitWidth: wsLayout.implicitWidth + 32
implicitHeight: moduleHeight
RowLayout {
id: wsLayout
anchors.centerIn: parent
anchors.horizontalCenter: parent.horizontalCenter
spacing: 8
Repeater {
id: wsRepeater
model: Hyprland.workspaces
delegate: WrapperRectangle {
id: wsWrapper
anchors.verticalCenter: parent.verticalCenter
parent: wsLayout
color: 'transparent'
visible: modelData.monitor == root.hyprBarScreen
required property var modelData
child: StyledText {
text: wsWrapper.modelData.id
opacity: wsWrapper.modelData.active ? 1.0 : 0.6
}
}
}
}
}