added center glow , wave animation etc.

This commit is contained in:
darksignal7
2025-10-04 17:28:30 +03:00
parent 0f29869a76
commit b0987b224d
4 changed files with 130 additions and 15 deletions
@@ -134,6 +134,8 @@ Singleton {
property bool hourDots: true
property bool timeIndicators: true
property bool minuteHandSizeAdjust: true
property bool centerGlow: true
property bool waveAnimation: true
}
}
@@ -1,6 +1,8 @@
import QtQuick
import QtQuick.Shapes
import Quickshell
import qs.modules.common
Item {
id: root
@@ -12,9 +14,25 @@ Item {
property color color: "#605790"
property alias strokeWidth: shapePath.strokeWidth
property bool waveAnimation: Config.options.background.clock.cookie.waveAnimation
implicitWidth: implicitSize
implicitHeight: implicitSize
property real waveTime: 0
Loader{
active: waveAnimation
sourceComponent: Timer{
interval: 16 // Does it effect performance, probably, is it noticeable, not really
running: true; repeat: true
onTriggered: {
root.waveTime += 0.05
}
}
}
Shape {
id: shape
anchors.fill: parent
@@ -35,7 +53,7 @@ Item {
var radius = root.implicitSize / 2 - root.amplitude
for (var i = 0; i <= steps; i++) {
var angle = (i / steps) * 2 * Math.PI
var wave = Math.sin(angle * root.sides + Math.PI/2) * root.amplitude
var wave = waveAnimation ? Math.sin(angle * root.sides + Math.PI/2 + root.waveTime) * root.amplitude : Math.sin(angle * root.sides + Math.PI/2) * root.amplitude
var x = Math.cos(angle) * (radius + wave) + cx
var y = Math.sin(angle) * (radius + wave) + cy
points.push(Qt.point(x, y))
@@ -45,6 +63,7 @@ Item {
path: pointsList
}
}
}
}