make workspaces prettier

This commit is contained in:
lucy 2026-08-26 19:58:25 +02:00
commit 4f8c553306
2 changed files with 38 additions and 26 deletions

View file

@ -4,35 +4,47 @@ import QtQuick
import QtQuick.Layouts
import qs
import qs.widgets
import qs.settings
BarComponent {
id: root
required property ShellScreen barScreen
implicitWidth: wsLayout.implicitWidth + wsLayout.spacing * 2
implicitWidth: wsLayout.implicitWidth + 4
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()
}
}
}
}
id: wsLayout
anchors.centerIn: parent
spacing: 8
Repeater {
model: WindowManager.screenProjection(root.barScreen).windowsets
delegate: Rectangle {
id: wsContainer
required property var modelData
visible: modelData.shouldDisplay
implicitWidth: modelData.active ? 50 : 20
implicitHeight: Config.moduleHeight - 4
color: modelData.active ? Colors.base0D : Colors.activeModuleBg
radius: Config.rounding
Behavior on implicitWidth {
PropertyAnimation {
duration: 350
easing.type: Easing.InOutBack
easing.overshoot: 1.2
}
}
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.active ? Colors.base00 : Colors.base0D
}
}
}
}
}