rename dateIndicator folder

This commit is contained in:
end-4
2025-10-11 10:55:35 +02:00
parent c519505296
commit 7ae53ac364
5 changed files with 3 additions and 2 deletions
@@ -0,0 +1,36 @@
pragma ComponentBehavior: Bound
import qs
import qs.services
import qs.modules.common
import qs.modules.common.widgets
import QtQuick
Item {
property int bubbleIndex: 0
property real targetSize: 0
MaterialCookie {
z: 5
sides: bubbleIndex === 0 ? 4 : 1
anchors.centerIn: parent
color: bubbleIndex === 0.0 ? Appearance.colors.colPrimaryContainer : Appearance.colors.colTertiaryContainer
implicitSize: targetSize
constantlyRotate: Config.options.background.clock.cookie.constantlyRotate
}
StyledText {
z: 6
anchors.centerIn: parent
text: bubbleIndex === 0.0 ? DateTime.date.substring(5, 7) : DateTime.date.substring(8, 10)
color: bubbleIndex === 0.0 ? Appearance.colors.colPrimary : Appearance.colors.colTertiary
opacity: root.style === "bubble" ? 1.0 : 0
font {
family: Appearance.font.family.expressive
pixelSize: 30
weight: 1000
}
Behavior on opacity {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
}
}
}
@@ -0,0 +1,93 @@
pragma ComponentBehavior: Bound
import qs
import qs.services
import qs.modules.common
import qs.modules.common.widgets
import qs.modules.common.functions
import QtQuick
Item {
id: root
readonly property string dialStyle: Config.options.background.clock.cookie.dialNumberStyle
property string style: "rotating"
property color colOnBackground: Appearance.colors.colOnSecondaryContainer
property color colBackground: Appearance.colors.colOnSecondaryContainer
property real dateSquareSize: 64
// Rotating date
Loader {
anchors.fill: parent
active: opacity > 0
sourceComponent: RotatingDate {
style: root.style
}
}
// Rectangle date (only today's number) in right side of the clock
Loader {
id: rectLoader
property real animIndex: root.style === "rect" ? 1.0 : 0.0
Behavior on animIndex {
animation: Appearance.animation.elementResize.numberAnimation.createObject(this)
}
active: animIndex > 0
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
sourceComponent: RectangleDate {
color: Appearance.colors.colSecondaryContainerHover
radius: Appearance.rounding.small
animIndex: rectLoader.animIndex
}
}
// Date bubble / day
Loader {
id: dayBubbleLoader
property real targetSize: root.style === "bubble" ? root.dateSquareSize : 0
Behavior on targetSize {
animation: Appearance.animation.elementResize.numberAnimation.createObject(this)
}
active: targetSize > 0
width: targetSize
height: targetSize
anchors {
left: parent.left
bottom: parent.bottom
topMargin: 50
}
sourceComponent: BubbleDate {
bubbleIndex: 0
targetSize: dayBubbleLoader.targetSize
}
}
// Date bubble / month
Loader {
id: monthBubbleLoader
property real targetSize: root.style === "bubble" ? root.dateSquareSize : 0
Behavior on targetSize {
animation: Appearance.animation.elementResize.numberAnimation.createObject(this)
}
width: targetSize
height: targetSize
active: targetSize > 0
anchors {
right: parent.right
top: parent.top
bottomMargin: 50
}
sourceComponent: BubbleDate {
bubbleIndex: 1
targetSize: monthBubbleLoader.targetSize
}
}
}
@@ -0,0 +1,41 @@
import qs
import qs.services
import qs.modules.common
import qs.modules.common.widgets
import QtQuick
Rectangle {
id: rect
readonly property string dialStyle: Config.options.background.clock.cookie.dialNumberStyle
property real animIndex: 0
opacity: animIndex
width: 45 * animIndex
height: 30 * animIndex
x: root.dialStyle === "numbers" ? -40 : -10
y: root.dialStyle === "numbers" ? 55 : 0
Behavior on x {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
}
Behavior on y {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
}
StyledText {
opacity: root.style === "rect" ? 1.0 : 0
Behavior on opacity {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
}
anchors.centerIn: parent
color: Appearance.colors.colSecondaryHover
text: DateTime.date.substring(5, 7)
font {
family: Appearance.font.family.expressive
pixelSize: 20
weight: 1000
}
}
}
@@ -0,0 +1,59 @@
pragma ComponentBehavior: Bound
import qs
import qs.services
import qs.modules.common
import qs.modules.common.widgets
import QtQuick
Item {
id: root
property string style: Config.options.background.clock.cookie.dateStyle
readonly property string dialStyle: Config.options.background.clock.cookie.dialNumberStyle
readonly property bool timeIndicators: Config.options.background.clock.cookie.timeIndicators
property real radius: style === "rotating" ? 90 : 0
Behavior on radius {
animation: Appearance.animation.elementResize.numberAnimation.createObject(this)
}
property string dateText: Qt.locale().toString(DateTime.clock.date, "ddd dd")
property real angleStep: Math.PI / 2.35 / dateText.length
property color dayColor: Appearance.colors.colSecondary
property color monthColor: Appearance.colors.colSecondaryHover
opacity: style === "rotating" ? 1.0 : 0.0
Behavior on opacity {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
}
rotation: {
if (!Config.options.time.secondPrecision) return 0
else return secondHandLoader.item.rotation + 45 // +45 to center the text
}
Repeater {
model: root.dateText.length
delegate: Text {
required property int index
property real angle: index * root.angleStep - Math.PI / 2
x: root.width / 2 + root.radius * Math.cos(angle) - width / 2
y: root.height / 2 + root.radius * Math.sin(angle) - height / 2
text: root.dateText.charAt(index)
font.family: Appearance.font.family.title
font.pixelSize: 30
font.weight: Font.DemiBold
color: index < 3 ? root.dayColor : root.monthColor
rotation: angle * 180 / Math.PI + 90
}
}
}