-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshell.qml
More file actions
80 lines (71 loc) · 3.12 KB
/
Copy pathshell.qml
File metadata and controls
80 lines (71 loc) · 3.12 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
//@ pragma UseQApplication
import QtQuick
import Quickshell
import Quickshell.Wayland
import "."
import "components"
ShellRoot {
Variants {
model: Quickshell.screens
PanelWindow {
id: root
required property var modelData
screen: modelData
WlrLayershell.layer: WlrLayer.Bottom
WlrLayershell.namespace: "m3qs"
exclusionMode: ExclusionMode.Ignore
color: "transparent"
anchors {
top: Config.anchorPosition === "topLeft" || Config.anchorPosition === "topRight"
bottom: Config.anchorPosition === "bottomLeft" || Config.anchorPosition === "bottomRight"
left: Config.anchorPosition === "topLeft" || Config.anchorPosition === "bottomLeft"
right: Config.anchorPosition === "topRight" || Config.anchorPosition === "bottomRight"
}
margins {
top: Config.anchorPosition === "center" ? 0 : Config.marginTop
bottom: Config.anchorPosition === "center" ? 0 : Config.marginBottom
left: Config.anchorPosition === "center" ? 0 : Config.marginLeft
right: Config.anchorPosition === "center" ? 0 : Config.marginRight
}
implicitWidth: blurWrapper.implicitWidth
implicitHeight: blurWrapper.implicitHeight
property date currentTime: new Date()
Timer {
interval: 1000
running: true
repeat: true
onTriggered: root.currentTime = new Date()
}
MotionBlurWrapper {
id: blurWrapper
anchors.centerIn: parent
implicitWidth: variantLoader.item ? variantLoader.item.implicitWidth : 260
implicitHeight: variantLoader.item ? variantLoader.item.implicitHeight : 260
velocityHint: variantLoader.item && variantLoader.item.blurVelocity
? variantLoader.item.blurVelocity
: Qt.vector2d(0, 0)
Loader {
id: variantLoader
anchors.fill: parent
sourceComponent: {
switch (Config.variant) {
case "scalloped": return scallopedComponent
case "pill": return pillComponent
case "world": return worldComponent
case "stacked":
default: return stackedComponent
}
}
onLoaded: {
if (item.hasOwnProperty("currentTime"))
item.currentTime = Qt.binding(function() { return root.currentTime })
}
}
}
Component { id: scallopedComponent; ScallopedAnalogClock {} }
Component { id: stackedComponent; StackedDigitalClock {} }
Component { id: pillComponent; PillDigitalClock {} }
Component { id: worldComponent; WorldClock {} }
}
}
}