forked from Shinonome/dots-hyprland
rename waveAnimation to constantlyRotate, disable by default
This commit is contained in:
@@ -94,7 +94,7 @@ Item {
|
|||||||
amplitude: implicitSize / 70
|
amplitude: implicitSize / 70
|
||||||
sides: Config.options.background.clock.clockSides
|
sides: Config.options.background.clock.clockSides
|
||||||
color: root.colBackground
|
color: root.colBackground
|
||||||
waveAnimation: Config.options.background.clock.cookie.waveAnimation
|
constantlyRotate: Config.options.background.clock.cookie.constantlyRotate
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hour dots dial style
|
// Hour dots dial style
|
||||||
|
|||||||
@@ -139,7 +139,7 @@ Singleton {
|
|||||||
property bool timeIndicators: true
|
property bool timeIndicators: true
|
||||||
property bool centerGlow: true
|
property bool centerGlow: true
|
||||||
property bool dateInClock: true
|
property bool dateInClock: true
|
||||||
property bool waveAnimation: true
|
property bool constantlyRotate: false
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,15 +14,14 @@ Item {
|
|||||||
property int renderPoints: 360
|
property int renderPoints: 360
|
||||||
property color color: "#605790"
|
property color color: "#605790"
|
||||||
property alias strokeWidth: shapePath.strokeWidth
|
property alias strokeWidth: shapePath.strokeWidth
|
||||||
property bool waveAnimation: false
|
property bool constantlyRotate: false
|
||||||
|
|
||||||
|
|
||||||
implicitWidth: implicitSize
|
implicitWidth: implicitSize
|
||||||
implicitHeight: implicitSize
|
implicitHeight: implicitSize
|
||||||
|
|
||||||
property real waveTime: 0
|
property real waveTime: 0
|
||||||
Loader{
|
Loader{
|
||||||
active: waveAnimation
|
active: constantlyRotate
|
||||||
sourceComponent: Timer{
|
sourceComponent: Timer{
|
||||||
interval: 16 // Does it effect performance, probably, is it noticeable, not really
|
interval: 16 // Does it effect performance, probably, is it noticeable, not really
|
||||||
running: true; repeat: true
|
running: true; repeat: true
|
||||||
@@ -60,7 +59,7 @@ Item {
|
|||||||
var radius = root.implicitSize / 2 - root.amplitude
|
var radius = root.implicitSize / 2 - root.amplitude
|
||||||
for (var i = 0; i <= steps; i++) {
|
for (var i = 0; i <= steps; i++) {
|
||||||
var angle = (i / steps) * 2 * Math.PI
|
var angle = (i / steps) * 2 * Math.PI
|
||||||
var wave = waveAnimation ? Math.sin(angle * root.animatedSides + Math.PI/2 - root.waveTime) * root.amplitude : Math.sin(angle * root.animatedSides + Math.PI/2) * root.amplitude
|
var wave = constantlyRotate ? Math.sin(angle * root.animatedSides + Math.PI/2 - root.waveTime) * root.amplitude : Math.sin(angle * root.animatedSides + Math.PI/2) * root.amplitude
|
||||||
var x = Math.cos(angle) * (radius + wave) + cx
|
var x = Math.cos(angle) * (radius + wave) + cx
|
||||||
var y = Math.sin(angle) * (radius + wave) + cy
|
var y = Math.sin(angle) * (radius + wave) + cy
|
||||||
points.push(Qt.point(x, y))
|
points.push(Qt.point(x, y))
|
||||||
|
|||||||
@@ -296,13 +296,13 @@ ContentPage {
|
|||||||
enabled: Config.options.background.clock.style === "cookie"
|
enabled: Config.options.background.clock.style === "cookie"
|
||||||
visible: Config.options.background.clock.style === "cookie"
|
visible: Config.options.background.clock.style === "cookie"
|
||||||
buttonIcon: "waves"
|
buttonIcon: "waves"
|
||||||
text: Translation.tr("Wave animation")
|
text: Translation.tr("Constantly rotate")
|
||||||
checked: Config.options.background.clock.cookie.waveAnimation
|
checked: Config.options.background.clock.cookie.constantlyRotate
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
Config.options.background.clock.cookie.waveAnimation = checked;
|
Config.options.background.clock.cookie.constantlyRotate = checked;
|
||||||
}
|
}
|
||||||
StyledToolTip {
|
StyledToolTip {
|
||||||
text: "It may effect performance"
|
text: "Makes the clock always rotate. This is extremely expensive (expect 50% usage on Intel UHD Graphics) and thus impractical."
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user