0.6.4: copertina con Casa e Acqua, attuale / impostata su due righe etichettate
This commit is contained in:
+52
-22
@@ -3,6 +3,11 @@ import Sailfish.Silica 1.0
|
||||
|
||||
// Copertina: legge api.summary (context property C++), quindi non dipende
|
||||
// dallo scope delle property della pagina principale.
|
||||
//
|
||||
// Due righe con l'etichetta davanti: "attuale / impostata" per la casa e per
|
||||
// l'acqua. Prima erano frasi lunghe ("casa · obiettivo 19,0 °C", "ACS 53,4 °C ·
|
||||
// obiettivo 55 °C") e sulla cover, che e' stretta, venivano tagliate a meta':
|
||||
// il numero vero spariva proprio dove serve di sfuggita.
|
||||
CoverBackground {
|
||||
id: cover
|
||||
|
||||
@@ -11,6 +16,11 @@ CoverBackground {
|
||||
return api.formatValue(v)
|
||||
}
|
||||
|
||||
// "22,9 / 19,0 °C": attuale e impostata, con l'unita' una volta sola.
|
||||
function coppia(attuale, impostata) {
|
||||
return cover.t(attuale) + " / " + cover.t(impostata) + " °C"
|
||||
}
|
||||
|
||||
// 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.
|
||||
@@ -53,34 +63,54 @@ CoverBackground {
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
width: parent.width - 2 * Theme.paddingLarge
|
||||
spacing: Theme.paddingSmall
|
||||
width: parent.width - 2 * Theme.paddingMedium
|
||||
spacing: Theme.paddingMedium
|
||||
|
||||
Label {
|
||||
Row {
|
||||
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"
|
||||
font.pixelSize: Theme.fontSizeHuge
|
||||
spacing: Theme.paddingSmall
|
||||
|
||||
Label {
|
||||
text: qsTr("House")
|
||||
color: Theme.secondaryColor
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
width: parent.width * 0.32
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Label {
|
||||
text: cover.coppia("zone1_temperature", "zone1_setpoint")
|
||||
// Spenta quando i numeri sono vecchi: non deve sembrare fresca.
|
||||
color: api.stale ? Theme.secondaryColor : Theme.primaryColor
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
font.bold: true
|
||||
elide: Text.ElideRight
|
||||
width: parent.width - parent.width * 0.32 - parent.spacing
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
Row {
|
||||
width: parent.width
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: qsTr("house · target %1 °C").arg(cover.t("zone1_setpoint"))
|
||||
color: Theme.secondaryColor
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
truncationMode: TruncationMode.Fade
|
||||
}
|
||||
spacing: Theme.paddingSmall
|
||||
|
||||
Label {
|
||||
width: parent.width
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
text: qsTr("DHW %1 °C · target %2 °C").arg(cover.t("dhw_current")).arg(cover.t("dhw_target"))
|
||||
color: Theme.secondaryColor
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
truncationMode: TruncationMode.Fade
|
||||
Label {
|
||||
text: qsTr("Water")
|
||||
color: Theme.secondaryColor
|
||||
font.pixelSize: Theme.fontSizeExtraSmall
|
||||
width: parent.width * 0.32
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
Label {
|
||||
text: cover.coppia("dhw_current", "dhw_target")
|
||||
color: api.stale ? Theme.secondaryColor : Theme.primaryColor
|
||||
font.pixelSize: Theme.fontSizeSmall
|
||||
font.bold: true
|
||||
elide: Text.ElideRight
|
||||
width: parent.width - parent.width * 0.32 - parent.spacing
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user