-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWorkspaces.qml
More file actions
97 lines (90 loc) · 3.29 KB
/
Workspaces.qml
File metadata and controls
97 lines (90 loc) · 3.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import QtQuick
import Quickshell.Hyprland
import "."
Item {
property int active: Hyprland.focusedWorkspace?.id - 1
anchors.centerIn: parent
width: container.width + 0.16 * Etc.factor
height: container.height
Item {
id: container
anchors.centerIn: parent
height: 0.76 * Etc.factor
width: container.height * 2 * repeater.model + container.height
Repeater {
id: repeater
model: Etc.workspaces
Item {
required property var modelData
id: notch
property int base: 1.52 * Etc.factor * modelData + 0.38 * Etc.factor
property int widthAbstraction: (modelData == active) ? Etc.factor * 1.52 : Etc.factor * 0.76
anchors.verticalCenter: container.verticalCenter
x: (modelData > active) ? base + widthAbstraction : base
width: widthAbstraction
height: 0.76 * Etc.factor
Behavior on width {
NumberAnimation {
duration: Etc.workspaceTransitionSpeed
}
}
Behavior on x {
NumberAnimation {
duration: Etc.workspaceTransitionSpeed
}
}
MouseArea {
anchors.fill: parent
onClicked: {
Hyprland.dispatch(`workspace ${modelData + 1}`);
}
}
Rectangle {
id: indicator
anchors.centerIn: parent
width: (modelData == active) ? Etc.factor * 1.2 : 0.44 * Etc.factor
height: 0.44 * Etc.factor
visible: (modelData == active) ? true : false
Behavior on width {
NumberAnimation {
duration: Etc.workspaceTransitionSpeed
}
}
}
Rectangle {
height: parent.height
width: 0.04 * Etc.factor
}
Rectangle {
height: parent.height
width: 0.04 * Etc.factor
anchors.right: parent.right
}
Rectangle {
width: 0.34 * parent.height
height: 0.04 * Etc.factor
anchors.left: parent.left
anchors.bottom: parent.bottom
}
Rectangle {
width: 0.34 * parent.height
height: 0.04 * Etc.factor
anchors.bottom: parent.bottom
anchors.right: notch.right
}
Rectangle {
width: 0.34 * parent.height
height: 0.04 * Etc.factor
anchors.left: parent.left
anchors.top: parent.top
}
Rectangle {
width: 0.34 * parent.height
height: 0.04 * Etc.factor
anchors.top: parent.top
anchors.right: notch.right
}
}
}
}
}