forked from Shinonome/dots-hyprland
add last refresh timestamp to weather popup
This commit is contained in:
@@ -100,5 +100,35 @@ StyledPopup {
|
|||||||
value: Weather.data.sunset
|
value: Weather.data.sunset
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Footer
|
||||||
|
ColumnLayout {
|
||||||
|
id: footer
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
spacing: 2
|
||||||
|
|
||||||
|
RowLayout {
|
||||||
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
spacing: 6
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: "Last Refresh:"
|
||||||
|
font {
|
||||||
|
weight: Font.Medium
|
||||||
|
pixelSize: Appearance.font.pixelSize.smaller
|
||||||
|
}
|
||||||
|
color: Appearance.colors.colOnSurfaceVariant
|
||||||
|
}
|
||||||
|
|
||||||
|
StyledText {
|
||||||
|
text: Weather.data.lastRefresh
|
||||||
|
font {
|
||||||
|
weight: Font.Medium
|
||||||
|
pixelSize: Appearance.font.pixelSize.smaller
|
||||||
|
}
|
||||||
|
color: Appearance.colors.colOnSurfaceVariant
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,7 +42,8 @@ Singleton {
|
|||||||
visib: 0,
|
visib: 0,
|
||||||
press: 0,
|
press: 0,
|
||||||
temp: 0,
|
temp: 0,
|
||||||
tempFeelsLike: 0
|
tempFeelsLike: 0,
|
||||||
|
lastRefresh: 0,
|
||||||
})
|
})
|
||||||
|
|
||||||
function refineData(data) {
|
function refineData(data) {
|
||||||
@@ -75,6 +76,7 @@ Singleton {
|
|||||||
temp.temp += "°C";
|
temp.temp += "°C";
|
||||||
temp.tempFeelsLike += "°C";
|
temp.tempFeelsLike += "°C";
|
||||||
}
|
}
|
||||||
|
temp.lastRefresh = Qt.locale().toString(new Date(), (Config.options?.time.format ?? "hh:mm") + " - " + (Config.options?.time.dateWithYearFormat ?? "dd/MM/yyyy"));
|
||||||
root.data = temp;
|
root.data = temp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user