51 lines
1.6 KiB
QML
51 lines
1.6 KiB
QML
pragma ComponentBehavior: Bound
|
|
import Quickshell
|
|
import Quickshell.Hyprland
|
|
import QtQuick
|
|
import QtQuick.Layouts
|
|
import qs
|
|
import qs.settings
|
|
import qs.widgets
|
|
|
|
Rectangle {
|
|
id: wsWrap
|
|
required property ShellScreen barScreen
|
|
color: ThemeLoader.colors.base03
|
|
radius: Settings.config.rounding
|
|
implicitWidth: wsLayout.implicitWidth + 6
|
|
implicitHeight: wsLayout.implicitHeight + 6
|
|
RowLayout {
|
|
id: wsLayout
|
|
spacing: 0
|
|
anchors.centerIn: parent
|
|
Repeater {
|
|
id: wsRep
|
|
model: Hyprland.workspaces
|
|
delegate: Rectangle {
|
|
id: wsRect
|
|
implicitWidth: Settings.config.barHeight / 2
|
|
implicitHeight: Settings.config.barHeight / 2
|
|
visible: modelData.monitor?.name == wsWrap.barScreen.name
|
|
required property var modelData
|
|
color: modelData.focused ? ThemeLoader.colors.base05 : ThemeLoader.colors.base03
|
|
radius: Settings.config.rounding
|
|
CText {
|
|
id: wsText
|
|
anchors.centerIn: parent
|
|
text: wsRect.modelData.id
|
|
color: parent.modelData.focused ? ThemeLoader.colors.base00 : ThemeLoader.colors.base05
|
|
}
|
|
MouseArea {
|
|
id: mouseHandler
|
|
acceptedButtons: Qt.LeftButton
|
|
anchors.fill: parent
|
|
cursorShape: Qt.PointingHandCursor
|
|
onClicked: {
|
|
wsRect.modelData.activate();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|