mirror of
https://github.com/kossLAN/dots.git
synced 2025-11-05 06:59:50 -05:00
still broken but getting there
This commit is contained in:
parent
189144099b
commit
446d83ce2c
20 changed files with 143 additions and 1219 deletions
72
shell/bar/Workspaces.qml
Normal file
72
shell/bar/Workspaces.qml
Normal file
|
|
@ -0,0 +1,72 @@
|
|||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
import qs
|
||||
|
||||
RowLayout {
|
||||
spacing: 6
|
||||
visible: Hyprland.monitors.values.length != 0
|
||||
|
||||
required property var screen
|
||||
|
||||
Repeater {
|
||||
id: workspaceButtons
|
||||
|
||||
model: ScriptModel {
|
||||
values: Hyprland.workspaces.values.slice().filter(workspace => workspace.monitor === Hyprland.monitorFor(screen))
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
radius: height / 2
|
||||
|
||||
color: {
|
||||
let value = ShellSettings.colors.active_translucent;
|
||||
|
||||
if (!modelData?.id || !Hyprland.focusedMonitor?.activeWorkspace?.id)
|
||||
return value;
|
||||
|
||||
if (workspaceButton.containsMouse) {
|
||||
value = ShellSettings.colors.highlight;
|
||||
} else if (Hyprland.focusedMonitor.activeWorkspace.id === modelData.id) {
|
||||
value = ShellSettings.colors.highlight;
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.preferredHeight: 12
|
||||
Layout.preferredWidth: {
|
||||
if (Hyprland.focusedMonitor?.activeWorkspace?.id === modelData?.id)
|
||||
return 25;
|
||||
|
||||
return 12;
|
||||
}
|
||||
|
||||
required property var modelData
|
||||
|
||||
Behavior on Layout.preferredWidth {
|
||||
SmoothedAnimation {
|
||||
duration: 150
|
||||
velocity: 200
|
||||
easing.type: Easing.OutCubic
|
||||
}
|
||||
}
|
||||
|
||||
Behavior on color {
|
||||
ColorAnimation {
|
||||
duration: 100
|
||||
easing.type: Easing.OutQuad
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: workspaceButton
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onPressed: Hyprland.dispatch(`workspace ${parent.modelData.id}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue