Narrow weather flyout and center forecast row

This commit is contained in:
Ryan Hughes
2026-05-16 00:41:41 -04:00
parent 079be0a1a7
commit fd36836eec
@@ -179,7 +179,7 @@ Item {
bar: root.bar bar: root.bar
open: root.popupOpen open: root.popupOpen
triggerMode: "click" triggerMode: "click"
contentWidth: 520 contentWidth: 440
contentHeight: card.implicitHeight + 28 contentHeight: card.implicitHeight + 28
Column { Column {
@@ -334,54 +334,60 @@ Item {
} }
// ---- Forecast row: each cell has the day icon left of a day-name + hi/lo column. // ---- Forecast row: each cell has the day icon left of a day-name + hi/lo column.
Row { // Wrapped in an Item so the block of cells can be centered within the popup.
id: forecastRow Item {
visible: root.forecastDays.length > 0 visible: root.forecastDays.length > 0
width: parent.width width: parent.width
height: forecastRow.height
Repeater { Row {
model: root.forecastDays id: forecastRow
anchors.horizontalCenter: parent.horizontalCenter
spacing: 44
Row { Repeater {
required property var modelData model: root.forecastDays
required property int index
width: forecastRow.width / Math.max(1, root.forecastDays.length)
spacing: 10
Text { Row {
anchors.verticalCenter: parent.verticalCenter required property var modelData
text: root.dayIcon(modelData) required property int index
color: root.bar.foreground spacing: 10
font.family: root.bar.fontFamily
font.pixelSize: 24
}
Column {
anchors.verticalCenter: parent.verticalCenter
spacing: 2
Text { Text {
text: root.dayName(modelData.date).toUpperCase() anchors.verticalCenter: parent.verticalCenter
color: Qt.darker(root.bar.foreground, 1.4) text: root.dayIcon(modelData)
color: root.bar.foreground
font.family: root.bar.fontFamily font.family: root.bar.fontFamily
font.pixelSize: 10 font.pixelSize: 24
font.letterSpacing: 1
} }
Row { Column {
spacing: 6 anchors.verticalCenter: parent.verticalCenter
spacing: 2
Text { Text {
text: root.bareTempForDay(modelData, "max") text: root.dayName(modelData.date).toUpperCase()
color: root.bar.foreground color: Qt.darker(root.bar.foreground, 1.4)
font.family: root.bar.fontFamily font.family: root.bar.fontFamily
font.pixelSize: 12 font.pixelSize: 10
font.letterSpacing: 1
} }
Text {
text: root.bareTempForDay(modelData, "min") Row {
color: Qt.darker(root.bar.foreground, 1.5) spacing: 6
font.family: root.bar.fontFamily
font.pixelSize: 12 Text {
text: root.bareTempForDay(modelData, "max")
color: root.bar.foreground
font.family: root.bar.fontFamily
font.pixelSize: 12
}
Text {
text: root.bareTempForDay(modelData, "min")
color: Qt.darker(root.bar.foreground, 1.5)
font.family: root.bar.fontFamily
font.pixelSize: 12
}
} }
} }
} }