add left and right spacing
This commit is contained in:
parent
5e2577b291
commit
56b5b0a4e6
2 changed files with 104 additions and 103 deletions
|
|
@ -9,49 +9,50 @@ import qs.widgets
|
|||
import qs.settings
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
required property ShellScreen barScreen
|
||||
required property double moduleHeight
|
||||
radius: Config.rounding
|
||||
color: 'transparent'
|
||||
implicitWidth: wsLayout.implicitWidth
|
||||
implicitHeight: moduleHeight
|
||||
id: root
|
||||
required property ShellScreen barScreen
|
||||
required property double moduleHeight
|
||||
radius: Config.rounding
|
||||
color: 'transparent'
|
||||
implicitWidth: wsLayout.implicitWidth
|
||||
implicitHeight: moduleHeight
|
||||
|
||||
RowLayout {
|
||||
id: wsLayout
|
||||
anchors.centerIn: root
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: 0
|
||||
Repeater {
|
||||
id: wsRepeater
|
||||
model: Hyprland.workspaces
|
||||
delegate: Rectangle {
|
||||
id: wsWrapper
|
||||
required property var modelData
|
||||
property bool active: modelData.active
|
||||
property bool vacant: modelData.toplevels.values.length === 0
|
||||
visible: Hyprland.monitorFor(root.barScreen) === wsWrapper.modelData.monitor
|
||||
RowLayout {
|
||||
id: wsLayout
|
||||
anchors.centerIn: root
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
spacing: 0
|
||||
Repeater {
|
||||
id: wsRepeater
|
||||
model: Hyprland.workspaces
|
||||
delegate: Rectangle {
|
||||
id: wsWrapper
|
||||
required property var modelData
|
||||
property bool active: modelData.active
|
||||
property bool vacant: modelData.toplevels.values.length === 0
|
||||
visible: Hyprland.monitorFor(root.barScreen) === wsWrapper.modelData.monitor
|
||||
|
||||
implicitHeight: root.moduleHeight
|
||||
implicitWidth: 16
|
||||
parent: wsLayout
|
||||
color: 'transparent'
|
||||
radius: Config.rounding
|
||||
implicitHeight: root.moduleHeight
|
||||
implicitWidth: 16
|
||||
parent: wsLayout
|
||||
color: 'transparent'
|
||||
radius: Config.rounding
|
||||
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: wsWrapper.modelData.id > 10 ? wsWrapper.modelData.id > 20 ? wsWrapper.modelData.id - 20 : wsWrapper.modelData.id - 10 : wsWrapper.modelData.id
|
||||
color: wsWrapper.active ? Colors.base0D : Colors.base04
|
||||
font.bold: wsWrapper.active
|
||||
}
|
||||
MouseArea {
|
||||
id: clickHandler
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: wsWrapper.ws.activate()
|
||||
}
|
||||
}
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: wsWrapper.modelData.id > 10 ? wsWrapper.modelData.id > 20 ? wsWrapper.modelData.id - 20 : wsWrapper.modelData.id - 10 : wsWrapper.modelData.id
|
||||
color: wsWrapper.active ? Colors.base0D : Colors.base04
|
||||
opacity: wsWrapper.active ? 1.0 : 0.4
|
||||
font.bold: wsWrapper.active
|
||||
}
|
||||
MouseArea {
|
||||
id: clickHandler
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: wsWrapper.ws.activate()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue