42 lines
1.4 KiB
QML
42 lines
1.4 KiB
QML
import Quickshell
|
|
import Quickshell.WindowManager
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
import qs
|
|
import qs.widgets
|
|
import qs.settings
|
|
|
|
BarComponent {
|
|
id: root
|
|
required property ShellScreen barScreen
|
|
implicitWidth: 10 * (16 + 4)
|
|
RowLayout {
|
|
id: wsLayout
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
spacing: 4
|
|
Repeater {
|
|
model: WindowManager.screenProjection(root.barScreen).windowsets
|
|
delegate: BarComponent {
|
|
id: wsContainer
|
|
required property var modelData
|
|
implicitWidth: 16
|
|
implicitHeight: implicitWidth
|
|
color: modelData.active ? Colors.c.base0D : 'transparent'
|
|
MouseArea {
|
|
id: clickHandler
|
|
anchors.fill: parent
|
|
cursorShape: Qt.PointingHandCursor
|
|
acceptedButtons: Qt.LeftButton
|
|
onClicked: wsContainer.modelData.activate()
|
|
}
|
|
StyledText {
|
|
id: wsText
|
|
anchors.centerIn: parent
|
|
text: parent.modelData.name
|
|
color: parent.modelData.shouldDisplay ? parent.modelData.active ? Colors.c.base00 : Colors.c.base05 : Colors.c.base03
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|