C

Qt Quick Ultralite Thermostat Demo

// Copyright (C) 2025 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial
import QtQuick 2.15
import Thermo 1.0

Item {
    id: root
    property int selected: GlobalState.statsContentViewIndex

    Image {
        source: "stats-month.png"
        visible: !selected
    }
    Image {
        source: "stats-year.png"
        visible: selected
    }
    Text {
        color: ColorStyle.greyDark1
        font.pixelSize: Theme.statsViewChartLabelFontSize
        horizontalAlignment: Text.AlignHCenter
        //% "Jan"
        text: selected ? qsTrId("id-jan") :
        //% "05/11"
        qsTrId("id-0511")
        width: 30
        x: 162
        y: 278
    }
    Text {
        color: ColorStyle.greyDark1
        font.pixelSize: Theme.statsViewChartLabelFontSize
        horizontalAlignment: Text.AlignHCenter
        //% "Feb"
        text: selected ? qsTrId("id-feb") :
        //% "05/12"
        qsTrId("id-0512")
        width: 30
        x: 273
        y: 278
    }
    Text {
        color: ColorStyle.greyDark1
        font.pixelSize: Theme.statsViewChartLabelFontSize
        horizontalAlignment: Text.AlignHCenter
        //% "Mar"
        text: selected ? qsTrId("id-mar") :
        //% "05/13"
        qsTrId("id-0513")
        width: 30
        x: 385
        y: 278
    }
    Text {
        color: ColorStyle.greyDark1
        font.pixelSize: Theme.statsViewChartLabelFontSize
        horizontalAlignment: Text.AlignHCenter
        //% "Apr"
        text: selected ? qsTrId("id-apr") :
        //% "05/14"
        qsTrId("id-0514")
        width: 30
        x: 503
        y: 278
    }
    Text {
        color: ColorStyle.greyDark1
        font.pixelSize: Theme.statsViewChartLabelFontSize
        horizontalAlignment: Text.AlignHCenter
        //% "May"
        text: selected ? qsTrId("id-may") :
        //% "05/15"
        qsTrId("id-0515")
        width: 30
        x: 615
        y: 278
    }
    Text {
        color: ColorStyle.greyDark1
        font.pixelSize: Theme.statsViewChartLabelFontSize
        horizontalAlignment: Text.AlignHCenter
        //% "Jun"
        text: selected ? qsTrId("id-jun") :
        //% "05/16"
        qsTrId("id-0516")
        width: 30
        x: 731
        y: 278
    }
}