summaryrefslogtreecommitdiff
path: root/modules/bar/components/Clock.qml
blob: f3e37013866dc97335af010691232232cc462590 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import "root:/widgets"
import "root:/services"
import "root:/config"
import QtQuick

StyledRect {
    id: root

    property color colour: Appearance.colours.peach

    MaterialIcon {
        id: icon

        text: "calendar_month"
        color: root.colour

        anchors.horizontalCenter: root.vertical ? parent.horizontalCenter : undefined
    }

    AnchorText {
        prevAnchor: icon

        horizontalAlignment: StyledText.AlignHCenter
        text: root.vertical ? Time.format("hh\nmm") : Time.format("hh:mm • dddd, dd MMMM")
        font.pointSize: Appearance.font.size.smaller
        font.family: Appearance.font.family.mono
        color: root.colour
    }
}