quickshell/modules/bar/Ws.qml

38 lines
897 B
QML

import Quickshell
import Quickshell.WindowManager
import QtQuick
import QtQuick.Layouts
import qs
import qs.widgets
BarComponent {
id: root
required property ShellScreen barScreen
implicitWidth: wsLayout.implicitWidth + wsLayout.spacing * 2
RowLayout {
id: wsLayout
spacing: 15
anchors.centerIn: parent
Repeater {
model: WindowManager.screenProjection(root.barScreen).windowsets
delegate: Rectangle {
id: wsContainer
required property var modelData
visible: modelData.shouldDisplay
StyledText {
id: wsText
anchors.centerIn: parent
text: parent.modelData.name
color: parent.modelData.active ? Colors.base0D: Colors.base03
MouseArea {
id: clickHandler
anchors.fill: parent
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton
onClicked: parent.parent.modelData.activate()
}
}
}
}
}
}