2026-03-08 13:44:57 +01:00
|
|
|
pragma ComponentBehavior: Bound
|
|
|
|
|
import Quickshell
|
2026-03-20 10:34:10 +01:00
|
|
|
import Quickshell.Widgets
|
2026-03-08 13:44:57 +01:00
|
|
|
import Quickshell.Hyprland
|
|
|
|
|
import QtQuick
|
2026-03-19 11:32:23 +01:00
|
|
|
import Qt5Compat.GraphicalEffects
|
2026-03-08 13:44:57 +01:00
|
|
|
import QtQuick.Layouts
|
|
|
|
|
import qs
|
|
|
|
|
import qs.settings
|
|
|
|
|
import qs.widgets
|
|
|
|
|
|
2026-03-20 10:34:10 +01:00
|
|
|
WrapperRectangle {
|
2026-03-08 13:44:57 +01:00
|
|
|
id: wsWrap
|
2026-03-20 10:34:10 +01:00
|
|
|
margin: Settings.config.barmargins
|
|
|
|
|
leftMargin: margin * 2
|
2026-03-08 13:44:57 +01:00
|
|
|
required property ShellScreen barScreen
|
2026-03-11 16:51:20 +01:00
|
|
|
color: "transparent"
|
2026-03-08 13:44:57 +01:00
|
|
|
radius: Settings.config.rounding
|
|
|
|
|
implicitWidth: wsLayout.implicitWidth + 6
|
2026-03-20 10:34:10 +01:00
|
|
|
implicitHeight: Settings.config.barHeight - margin * 2
|
|
|
|
|
child: Item {
|
|
|
|
|
RowLayout {
|
|
|
|
|
id: wsLayout
|
|
|
|
|
spacing: 6
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
Repeater {
|
|
|
|
|
id: wsRep
|
|
|
|
|
model: Hyprland.workspaces
|
|
|
|
|
delegate: Rectangle {
|
|
|
|
|
id: wsRect
|
|
|
|
|
layer {
|
|
|
|
|
enabled: true
|
|
|
|
|
effect: DropShadow {
|
2026-03-23 11:22:31 +01:00
|
|
|
color: "#111111"
|
|
|
|
|
radius: 0
|
|
|
|
|
verticalOffset: 2
|
|
|
|
|
horizontalOffset: 2
|
2026-03-20 10:34:10 +01:00
|
|
|
samples: 16
|
|
|
|
|
}
|
2026-03-19 11:32:23 +01:00
|
|
|
}
|
2026-03-20 10:34:10 +01:00
|
|
|
implicitWidth: modelData.focused ? Settings.config.barHeight * 1.5 : Settings.config.barHeight / 2 + 10
|
|
|
|
|
implicitHeight: Settings.config.barHeight - wsWrap.margin * 2
|
|
|
|
|
visible: modelData.id < 0 ? false : modelData.monitor?.name == wsWrap.barScreen.name
|
|
|
|
|
required property var modelData
|
|
|
|
|
color: modelData.focused ? Colors.base0D : Colors.base02
|
|
|
|
|
radius: Settings.config.rounding
|
|
|
|
|
CText {
|
|
|
|
|
id: wsText
|
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
text: wsRect.modelData.id
|
|
|
|
|
opacity: parent.modelData.focused ? 1 : 0.5
|
|
|
|
|
color: parent.modelData.focused ? Colors.base00 : Colors.base07
|
|
|
|
|
}
|
|
|
|
|
Behavior on implicitWidth {
|
|
|
|
|
NumberAnimation {
|
|
|
|
|
easing {
|
|
|
|
|
type: Easing.OutBack
|
|
|
|
|
overshoot: 2
|
|
|
|
|
}
|
|
|
|
|
duration: 400
|
2026-03-11 16:51:20 +01:00
|
|
|
}
|
|
|
|
|
}
|
2026-03-20 10:34:10 +01:00
|
|
|
MouseArea {
|
|
|
|
|
id: mouseHandler
|
|
|
|
|
acceptedButtons: Qt.LeftButton
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
|
onClicked: {
|
|
|
|
|
wsRect.modelData.activate();
|
|
|
|
|
}
|
2026-03-08 13:44:57 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|