forked from Shinonome/dots-hyprland
bg clock: fix cursed bubble date
This commit is contained in:
@@ -7,27 +7,31 @@ import qs.modules.common.widgets
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
property int bubbleIndex: 0
|
property bool isMonth: false
|
||||||
property real targetSize: 0
|
property real targetSize: 0
|
||||||
|
property alias text: bubbleText.text
|
||||||
|
|
||||||
|
text: Qt.locale().toString(DateTime.clock.date, isMonth ? "MM" : "d")
|
||||||
|
|
||||||
MaterialCookie {
|
MaterialCookie {
|
||||||
z: 5
|
z: 5
|
||||||
sides: bubbleIndex === 0 ? 4 : 1
|
sides: isMonth ? 1 : 4
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: bubbleIndex === 0.0 ? Appearance.colors.colTertiaryContainer : Appearance.colors.colPrimaryContainer
|
color: isMonth ? Appearance.colors.colPrimaryContainer : Appearance.colors.colTertiaryContainer
|
||||||
implicitSize: targetSize
|
implicitSize: targetSize
|
||||||
constantlyRotate: Config.options.background.clock.cookie.constantlyRotate
|
constantlyRotate: Config.options.background.clock.cookie.constantlyRotate
|
||||||
}
|
}
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
|
id: bubbleText
|
||||||
z: 6
|
z: 6
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: bubbleIndex === 0.0 ? DateTime.date.substring(5, 7) : DateTime.date.substring(8, 10)
|
color: isMonth ? Appearance.colors.colPrimary : Appearance.colors.colTertiary
|
||||||
color: bubbleIndex === 0.0 ? Appearance.colors.colTertiary : Appearance.colors.colPrimary
|
opacity: root.style === "bubble" ? 1 : 0
|
||||||
opacity: root.style === "bubble" ? 1.0 : 0
|
|
||||||
font {
|
font {
|
||||||
family: Appearance.font.family.expressive
|
family: Appearance.font.family.expressive
|
||||||
pixelSize: 30
|
pixelSize: 30
|
||||||
weight: 1000
|
weight: Font.Black
|
||||||
}
|
}
|
||||||
Behavior on opacity {
|
Behavior on opacity {
|
||||||
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
animation: Appearance.animation.elementMoveFast.numberAnimation.createObject(this)
|
||||||
|
|||||||
+2
-2
@@ -53,7 +53,7 @@ Item {
|
|||||||
sourceComponent: BubbleDate {
|
sourceComponent: BubbleDate {
|
||||||
implicitWidth: dayBubbleLoader.targetSize
|
implicitWidth: dayBubbleLoader.targetSize
|
||||||
implicitHeight: dayBubbleLoader.targetSize
|
implicitHeight: dayBubbleLoader.targetSize
|
||||||
bubbleIndex: 0
|
isMonth: false
|
||||||
targetSize: dayBubbleLoader.targetSize
|
targetSize: dayBubbleLoader.targetSize
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -71,7 +71,7 @@ Item {
|
|||||||
sourceComponent: BubbleDate {
|
sourceComponent: BubbleDate {
|
||||||
implicitWidth: monthBubbleLoader.targetSize
|
implicitWidth: monthBubbleLoader.targetSize
|
||||||
implicitHeight: monthBubbleLoader.targetSize
|
implicitHeight: monthBubbleLoader.targetSize
|
||||||
bubbleIndex: 1
|
isMonth: true
|
||||||
targetSize: monthBubbleLoader.targetSize
|
targetSize: monthBubbleLoader.targetSize
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user