make dwm-like setup with 10 workspaces per monitor
This commit is contained in:
parent
0f6bc633a5
commit
6fc103cf24
4 changed files with 142 additions and 65 deletions
62
2
Normal file
62
2
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import qs
|
||||
import qs.widgets
|
||||
import qs.settings
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
required property ShellScreen barScreen
|
||||
required property double moduleHeight
|
||||
property HyprlandMonitor hyprBarScreen: Hyprland.monitorFor(root.barScreen)
|
||||
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: 11
|
||||
delegate: Rectangle {
|
||||
id: wsWrapper
|
||||
implicitHeight: root.moduleHeight
|
||||
implicitWidth: 16
|
||||
parent: wsLayout
|
||||
color: 'transparent'
|
||||
radius: Config.rounding
|
||||
visible: Hyprland.workspaces?.values[modelData].monitor == root.hyprBarScreen
|
||||
required property var modelData
|
||||
StyledText {
|
||||
anchors.centerIn: parent
|
||||
text: wsWrapper.modelData
|
||||
color: Hyprland.workspaces?.values[modelData].active ? Colors.base0D : Colors.base04
|
||||
opacity: parent.modelData.active ? 1.0 : 0.5
|
||||
}
|
||||
Behavior on implicitWidth {
|
||||
NumberAnimation {
|
||||
easing.type: Easing.InOutBack
|
||||
easing.amplitude: 2
|
||||
duration: 400
|
||||
easing.overshoot: 2
|
||||
}
|
||||
}
|
||||
MouseArea {
|
||||
id: clickHandler
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.LeftButton
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: parent.modelData.activate()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue