0.6.0: copertina con pallino di stato, numeri vecchi spenti ed etichetta esterna; catalogo 191/191

This commit is contained in:
2026-10-10 09:55:30 +02:00
parent 5305fab309
commit 75c61cace2
10 changed files with 64 additions and 20 deletions
+41 -9
View File
@@ -11,14 +11,40 @@ CoverBackground {
return api.formatValue(v)
}
Label {
id: titleLabel
// Colore del pallino: gli stessi criteri della Home (vedi MainPage.qml).
// Un dato vecchio e' ambra come un modo attivo: un dato vecchio non e' un
// dato buono, e la copertina e' il posto dove si guarda di sfuggita.
function statusColor() {
if (!api.hasData || api.stale)
return "orange"
var livello = api.statusLevel()
if (livello === 2)
return Theme.errorColor
if (livello === 1)
return Theme.highlightColor
return "#4caf50"
}
Row {
id: intestazione
anchors.horizontalCenter: parent.horizontalCenter
anchors.top: parent.top
anchors.topMargin: Theme.paddingLarge
text: "Aira"
color: Theme.primaryColor
font.pixelSize: Theme.fontSizeLarge
spacing: Theme.paddingSmall
Rectangle {
anchors.verticalCenter: parent.verticalCenter
width: Theme.paddingSmall
height: width
radius: width / 2
color: cover.statusColor()
}
Label {
text: "Aira"
color: Theme.primaryColor
font.pixelSize: Theme.fontSizeLarge
}
}
Column {
@@ -29,8 +55,9 @@ CoverBackground {
Label {
width: parent.width
horizontalAlignment: Text.AlignHCenter
// Spenta quando i numeri sono vecchi: non deve sembrare fresca.
color: api.stale ? Theme.secondaryColor : Theme.primaryColor
text: cover.t("zone1_temperature") + " °C"
color: Theme.primaryColor
font.pixelSize: Theme.fontSizeHuge
}
@@ -57,8 +84,13 @@ CoverBackground {
anchors.horizontalCenter: parent.horizontalCenter
anchors.bottom: parent.bottom
anchors.bottomMargin: Theme.paddingMedium
text: qsTr("outdoor %1 °C").arg(cover.t("outdoor_temperature"))
color: Theme.secondaryColor
// Qui c'e' posto per dire che i numeri non sono freschi.
text: api.stale
? qsTr("Not updated · last %1").arg(api.lastUpdate)
: qsTr("outside %1 °C").arg(cover.t("outdoor_temperature"))
color: api.stale ? "orange" : Theme.secondaryColor
font.pixelSize: Theme.fontSizeExtraSmall
truncationMode: TruncationMode.Fade
width: parent.width - 2 * Theme.paddingMedium
}
}
}