67 lines
1.3 KiB
QML
67 lines
1.3 KiB
QML
import QtQuick
|
|
import QtQuick.Layouts
|
|
import ZShell.Components
|
|
import qs.Components
|
|
import ZShell.Config
|
|
import qs.Helpers
|
|
import qs.Services
|
|
|
|
SnapLayout {
|
|
orientation: Qt.Vertical
|
|
id: root
|
|
|
|
required property int rootHeight
|
|
|
|
spacing: Tokens.spacing.extraSmall
|
|
|
|
CustomText {
|
|
Layout.alignment: Qt.AlignHCenter
|
|
animate: true
|
|
color: Colors.palette.m3onSurfaceVariant
|
|
font: Tokens.font.body.large
|
|
text: Weather.description
|
|
}
|
|
|
|
SnapLayout {
|
|
Layout.alignment: Qt.AlignHCenter
|
|
spacing: Tokens.spacing.small
|
|
|
|
CustomText {
|
|
id: temp
|
|
|
|
animate: true
|
|
color: Colors.palette.m3primary
|
|
font: Tokens.font.title.large
|
|
text: Weather.temp
|
|
}
|
|
|
|
MaterialIcon {
|
|
animate: true
|
|
color: Colors.palette.m3secondary
|
|
text: Weather.icon
|
|
fontStyle: Tokens.font.icon.large
|
|
}
|
|
}
|
|
|
|
CustomText {
|
|
Layout.alignment: Qt.AlignHCenter
|
|
animate: true
|
|
color: Colors.palette.m3onSurfaceVariant
|
|
font: Tokens.font.body.large
|
|
text: qsTr("Feels like %1").arg(Weather.temp)
|
|
visible: root.rootHeight > 550
|
|
}
|
|
|
|
CustomText {
|
|
Layout.alignment: Qt.AlignHCenter
|
|
animate: true
|
|
color: Colors.palette.m3onSurfaceVariant
|
|
font: Tokens.font.body.medium
|
|
text: {
|
|
const today = Weather.forecast[0];
|
|
return qsTr("High %1 • Low %2").arg(Weather.formatTemp(today?.maxTempC)).arg(Weather.formatTemp(today?.minTempC));
|
|
}
|
|
visible: root.rootHeight > 550
|
|
}
|
|
}
|