quickshell/modules/bar/Ws.qml

44 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: wsLayout.implicitWidth + 16
RowLayout {
id: wsLayout
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
spacing: 4
Repeater {
model: WindowManager.screenProjection(root.barScreen).windowsets
delegate: Rectangle {
id: wsContainer
required property var modelData
radius: Config.cfg.appearance.rounding
implicitWidth: 16
implicitHeight: implicitWidth
color: modelData.active ? Colors.accent : '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.font : Colors.font
opacity: parent.modelData.shouldDisplay ? 1.0 : 0.2
}
}
}
}
}