WeatherCard: reworked since last merge introduced anchoring on Layout elements which is not allowed.

This commit is contained in:
ItsLemmy
2025-10-24 14:31:45 -04:00
parent 0c08a94acd
commit 19a1d177df
+10 -7
View File
@@ -16,13 +16,13 @@ NBox {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
anchors.margins: Style.marginM anchors.margins: Style.marginXL
spacing: Style.marginM spacing: Style.marginM
clip: true clip: true
RowLayout { RowLayout {
id: weatherCurrent id: weatherCurrent
anchors.left: weatherForecast.left Layout.fillWidth: true
spacing: Style.marginS spacing: Style.marginS
NIcon { NIcon {
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
@@ -79,23 +79,26 @@ NBox {
} }
RowLayout { RowLayout {
id: weatherForecast
visible: weatherReady visible: weatherReady
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter Layout.alignment: Qt.AlignVCenter
spacing: Style.marginL spacing: Style.marginM
Repeater { Repeater {
model: weatherReady ? LocationService.data.weather.daily.time : [] model: weatherReady ? LocationService.data.weather.daily.time : []
delegate: ColumnLayout { delegate: ColumnLayout {
Layout.alignment: Qt.AlignHCenter Layout.fillWidth: true
spacing: Style.marginXS spacing: Style.marginXS
Item {
Layout.fillWidth: true
}
NText { NText {
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter
text: { text: {
var weatherDate = new Date(LocationService.data.weather.daily.time[index].replace(/-/g, "/")) var weatherDate = new Date(LocationService.data.weather.daily.time[index].replace(/-/g, "/"))
return Qt.locale().toString(weatherDate, "ddd") return Qt.locale().toString(weatherDate, "ddd")
} }
color: Color.mOnSurface color: Color.mOnSurface
Layout.alignment: Qt.AlignHCenter
} }
NIcon { NIcon {
Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter Layout.alignment: Qt.AlignVCenter | Qt.AlignHCenter