blob: 027b5750de6f0c957a3810887da43e644ec5a87e (
plain)
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
|
import "root:/widgets"
import "root:/services"
import "root:/config"
import QtQuick
import Qt5Compat.GraphicalEffects
Rectangle {
id: root
required property bool vertical
required property list<Workspace> workspaces
required property Item mask
required property real maskWidth
required property real maskHeight
required property int groupOffset
property int currentIdx: (Hyprland.activeWorkspace?.id ?? 1) - 1 - groupOffset
property int lastIdx: currentIdx
property real leading: workspaces[currentIdx][vertical ? "y" : "x"]
property real trailing: workspaces[lastIdx][vertical ? "y" : "x"]
property real currentSize: workspaces[currentIdx][vertical ? "height" : "width"]
property real size: Math.abs(leading - trailing) + currentSize
property real offset: Math.min(leading, trailing)
clip: true
x: vertical ? 1 : offset + 1
y: vertical ? offset + 1 : 1
width: (vertical ? BarConfig.sizes.innerHeight : size) - 2
height: (vertical ? size : BarConfig.sizes.innerHeight) - 2
color: Appearance.colours.mauve
radius: Appearance.rounding.full
anchors.horizontalCenter: vertical ? parent.horizontalCenter : undefined
anchors.verticalCenter: vertical ? undefined : parent.verticalCenter
Rectangle {
id: base
visible: false
anchors.fill: parent
color: Appearance.colours.base
Behavior on color {
ColorAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
}
OpacityMask {
source: base
maskSource: root.mask
x: root.vertical ? 0 : -parent.offset
y: root.vertical ? -parent.offset : 0
width: root.maskWidth
height: root.maskHeight
anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined
anchors.verticalCenter: root.vertical ? undefined : parent.verticalCenter
}
Behavior on color {
ColorAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.standard
}
}
Behavior on leading {
Anim {}
}
Behavior on trailing {
Anim {
duration: Appearance.anim.durations.normal * 2
}
}
Behavior on currentSize {
Anim {}
}
component Anim: NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
|