blob: 0e24242b60d549d128e8d660a78e4a512fb76224 (
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
|
pragma ComponentBehavior: Bound
import "root:/widgets"
import "root:/services"
import "root:/utils"
import "root:/config"
import QtQuick
StyledRect {
id: root
property color colour: Colours.palette.pink
clip: true
MaterialIcon {
id: icon
animate: true
text: Icons.getAppCategoryIcon(Hyprland.activeClient?.wmClass, "desktop_windows")
color: root.colour
anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined
}
AnchorText {
id: text
prevAnchor: icon
text: metrics.elidedText
font.pointSize: metrics.font.pointSize
font.family: metrics.font.family
color: root.colour
transform: Rotation {
angle: vertical ? 90 : 0
origin.x: text.implicitHeight / 2
origin.y: text.implicitHeight / 2
}
width: vertical ? implicitHeight : implicitWidth
height: vertical ? implicitWidth : implicitHeight
}
TextMetrics {
id: metrics
text: Hyprland.activeClient?.title ?? qsTr("Desktop")
font.pointSize: Appearance.font.size.smaller
font.family: Appearance.font.family.mono
elide: Qt.ElideRight
elideWidth: root.vertical ? BarConfig.sizes.maxLabelHeight : BarConfig.sizes.maxLabelWidth
}
Behavior on implicitWidth {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
Behavior on implicitHeight {
NumberAnimation {
duration: Appearance.anim.durations.normal
easing.type: Easing.BezierSpline
easing.bezierCurve: Appearance.anim.curves.emphasized
}
}
}
|