mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-10 15:52:58 -04:00
@@ -14,7 +14,7 @@ Item {
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
spacing: Theme.spacingL
|
||||
visible: !WeatherService.weather.available || WeatherService.weather.temp === 0
|
||||
visible: !WeatherService.weather.available
|
||||
|
||||
DankIcon {
|
||||
name: "cloud_off"
|
||||
@@ -34,7 +34,7 @@ Item {
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
spacing: Theme.spacingM
|
||||
visible: WeatherService.weather.available && WeatherService.weather.temp !== 0
|
||||
visible: WeatherService.weather.available
|
||||
|
||||
Item {
|
||||
width: parent.width
|
||||
@@ -358,7 +358,16 @@ Item {
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: WeatherService.weather.wind || "--"
|
||||
text: {
|
||||
if (!WeatherService.weather.wind) return "--"
|
||||
const windKmh = parseFloat(WeatherService.weather.wind)
|
||||
if (isNaN(windKmh)) return WeatherService.weather.wind
|
||||
if (SettingsData.useFahrenheit) {
|
||||
const windMph = Math.round(windKmh * 0.621371)
|
||||
return windMph + " mph"
|
||||
}
|
||||
return WeatherService.weather.wind
|
||||
}
|
||||
font.pixelSize: Theme.fontSizeSmall + 1
|
||||
color: Theme.surfaceText
|
||||
font.weight: Font.Medium
|
||||
@@ -405,7 +414,15 @@ Item {
|
||||
}
|
||||
|
||||
StyledText {
|
||||
text: WeatherService.weather.pressure ? WeatherService.weather.pressure + " hPa" : "--"
|
||||
text: {
|
||||
if (!WeatherService.weather.pressure) return "--"
|
||||
const pressureHpa = WeatherService.weather.pressure
|
||||
if (SettingsData.useFahrenheit) {
|
||||
const pressureInHg = (pressureHpa * 0.02953).toFixed(2)
|
||||
return pressureInHg + " inHg"
|
||||
}
|
||||
return pressureHpa + " hPa"
|
||||
}
|
||||
font.pixelSize: Theme.fontSizeSmall + 1
|
||||
color: Theme.surfaceText
|
||||
font.weight: Font.Medium
|
||||
|
||||
Reference in New Issue
Block a user