nosignal-shell/modules/dashboard/dash/DateTime.qml
2 * r + 2 * t 4f7f21a86d internal: no async loaders
Fixes reload issue and all stuff not loading issues
2026-01-16 01:40:38 +11:00

67 lines
2 KiB
QML

pragma ComponentBehavior: Bound
import qs.components
import qs.services
import qs.config
import QtQuick
import QtQuick.Layouts
Item {
id: root
readonly property list<string> timeComponents: Time.format(Config.services.useTwelveHourClock ? "hh:mm:A" : "hh:mm").split(":")
anchors.top: parent.top
anchors.bottom: parent.bottom
implicitWidth: Config.dashboard.sizes.dateTimeWidth
ColumnLayout {
anchors.left: parent.left
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
spacing: 0
StyledText {
Layout.bottomMargin: -(font.pointSize * 0.4)
Layout.alignment: Qt.AlignHCenter
text: root.timeComponents[0]
color: Colours.palette.m3secondary
font.pointSize: Appearance.font.size.extraLarge
font.family: Appearance.font.family.clock
font.weight: 600
}
StyledText {
Layout.alignment: Qt.AlignHCenter
text: "•••"
color: Colours.palette.m3primary
font.pointSize: Appearance.font.size.extraLarge * 0.9
font.family: Appearance.font.family.clock
}
StyledText {
Layout.topMargin: -(font.pointSize * 0.4)
Layout.alignment: Qt.AlignHCenter
text: root.timeComponents[1]
color: Colours.palette.m3secondary
font.pointSize: Appearance.font.size.extraLarge
font.family: Appearance.font.family.clock
font.weight: 600
}
Loader {
Layout.alignment: Qt.AlignHCenter
active: Config.services.useTwelveHourClock
visible: active
sourceComponent: StyledText {
text: root.timeComponents[2] ?? ""
color: Colours.palette.m3primary
font.pointSize: Appearance.font.size.large
font.family: Appearance.font.family.clock
font.weight: 600
}
}
}
}