Improve cookie clock style (#2117)

This commit is contained in:
end-4
2025-10-11 18:18:00 +02:00
committed by GitHub
24 changed files with 1217 additions and 170 deletions
@@ -129,10 +129,24 @@ Singleton {
property bool show: true
property string style: "cookie" // Options: "cookie", "digital"
property real scale: 1
property JsonObject cookie: JsonObject {
property int sides: 14
property string dialNumberStyle: "full" // Options: "dots" , "numbers", "full" , "none"
property string hourHandStyle: "fill" // Options: "classic", "fill", "hollow", "hide"
property string minuteHandStyle: "medium" // Options "classic", "thin", "medium", "bold", "hide"
property string secondHandStyle: "dot" // Options: "dot", "line" , "hide"
property string dateStyle: "bubble" // Options: "border", "rect", "bubble" , "hide"
property bool timeIndicators: true
property bool hourMarks: true
property bool dateInClock: true
property bool constantlyRotate: false
}
}
property string wallpaperPath: ""
property string thumbnailPath: ""
property string quote: ""
property bool showQuote: false
property bool hideWhenFullscreen: true
property JsonObject parallax: JsonObject {
property bool vertical: false
@@ -360,6 +374,7 @@ Singleton {
property int focus: 1500
property int longBreak: 900
}
property bool secondPrecision: false
}
property JsonObject wallpaperSelector: JsonObject {
@@ -0,0 +1,16 @@
import QtQuick
import qs.modules.common
import qs.modules.common.widgets
Loader {
id: root
property bool shown: true
opacity: shown ? 1 : 0
visible: opacity > 0
active: opacity > 0
Behavior on opacity {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
}
}
@@ -1,20 +1,39 @@
import QtQuick
import QtQuick.Shapes
import Quickshell
import qs.modules.common
Item {
id: root
property int sides: 12
property real sides: 12
property int implicitSize: 100
property real amplitude: implicitSize / 50
property int renderPoints: 360
property color color: "#605790"
property alias strokeWidth: shapePath.strokeWidth
property bool constantlyRotate: false
implicitWidth: implicitSize
implicitHeight: implicitSize
property real shapeRotation: 0
Loader {
active: constantlyRotate
sourceComponent: FrameAnimation {
running: true
onTriggered: {
shapeRotation += 0.05
}
}
}
Behavior on sides {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
}
Shape {
id: shape
anchors.fill: parent
@@ -35,7 +54,8 @@ 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 rotatedAngle = angle * root.sides + Math.PI/2 + (root.shapeRotation * root.constantlyRotate)
var wave = Math.sin(rotatedAngle) * 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 +65,7 @@ Item {
path: pointsList
}
}
}
}
@@ -23,7 +23,7 @@ GroupButton {
colBackgroundActive: Appearance.colors.colSecondaryContainerActive
contentItem: RowLayout {
spacing: 4
spacing: 4 * (root.buttonText?.length > 0)
Loader {
Layout.alignment: Qt.AlignVCenter
@@ -42,7 +42,7 @@ GroupButton {
}
Item {
implicitWidth: textItem.implicitWidth
implicitWidth: root.buttonText?.length > 0 ? textItem.implicitWidth : 0
implicitHeight: textMetrics.height // Force height to that of regular text
TextMetrics {