bg clock: fix cursed bubble date

This commit is contained in:
end-4
2025-10-13 15:11:58 +02:00
parent 28078910a2
commit 2d2145a780
2 changed files with 13 additions and 9 deletions
@@ -7,27 +7,31 @@ import qs.modules.common.widgets
import QtQuick
Item {
property int bubbleIndex: 0
property bool isMonth: false
property real targetSize: 0
property alias text: bubbleText.text
text: Qt.locale().toString(DateTime.clock.date, isMonth ? "MM" : "d")
MaterialCookie {
z: 5
sides: bubbleIndex === 0 ? 4 : 1
sides: isMonth ? 1 : 4
anchors.centerIn: parent
color: bubbleIndex === 0.0 ? Appearance.colors.colTertiaryContainer : Appearance.colors.colPrimaryContainer
color: isMonth ? Appearance.colors.colPrimaryContainer : Appearance.colors.colTertiaryContainer
implicitSize: targetSize
constantlyRotate: Config.options.background.clock.cookie.constantlyRotate
}
StyledText {
id: bubbleText
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.colTertiary : Appearance.colors.colPrimary
opacity: root.style === "bubble" ? 1.0 : 0
color: isMonth ? Appearance.colors.colPrimary : Appearance.colors.colTertiary
opacity: root.style === "bubble" ? 1 : 0
font {
family: Appearance.font.family.expressive
pixelSize: 30
weight: 1000
weight: Font.Black
}
Behavior on opacity {
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
@@ -53,7 +53,7 @@ Item {
sourceComponent: BubbleDate {
implicitWidth: dayBubbleLoader.targetSize
implicitHeight: dayBubbleLoader.targetSize
bubbleIndex: 0
isMonth: false
targetSize: dayBubbleLoader.targetSize
}
}
@@ -71,7 +71,7 @@ Item {
sourceComponent: BubbleDate {
implicitWidth: monthBubbleLoader.targetSize
implicitHeight: monthBubbleLoader.targetSize
bubbleIndex: 1
isMonth: true
targetSize: monthBubbleLoader.targetSize
}
}