import QtQuick

// Mirrors eww clock-widget: click to toggle time ↔ date
Rectangle {
    id: root
    property string clockTime: ""
    property string clockDate: ""

    property bool showDate: false

    implicitWidth:  lbl.implicitWidth + 16
    implicitHeight: 22
    radius: 4
    color: "#313244"

    Text {
        id: lbl
        anchors.centerIn: parent
        text: root.showDate ? root.clockDate : root.clockTime
        color: "#cdd6f4"
        font.pixelSize: 12
        font.family: "monospace"
    }

    MouseArea {
        anchors.fill: parent
        onClicked: root.showDate = !root.showDate
    }
}
