1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-11 07:52:50 -05:00

layout adjustments

This commit is contained in:
bbedward
2025-09-10 09:23:14 -04:00
parent 9438868706
commit fb01d1af4b
6 changed files with 86 additions and 15 deletions

View File

@@ -13,6 +13,7 @@ Singleton {
property string fullName: ""
property string profilePicture: ""
property string uptime: ""
property string shortUptime: ""
property string hostname: ""
property bool profileAvailable: false
@@ -95,6 +96,19 @@ Singleton {
} else {
root.uptime = `up ${seconds} seconds`
}
// Create short uptime format
let shortUptime = "up"
if (days > 0) {
shortUptime += ` ${days}d`
}
if (hours > 0) {
shortUptime += ` ${hours}h`
}
if (minutes > 0) {
shortUptime += ` ${minutes}m`
}
root.shortUptime = shortUptime
}
}
}

View File

@@ -112,6 +112,40 @@ Singleton {
return iconMap[String(code)] || "cloud"
}
function getWeatherCondition(code) {
const conditions = {
"0": "Clear",
"1": "Clear",
"2": "Partly cloudy",
"3": "Overcast",
"45": "Fog",
"48": "Fog",
"51": "Drizzle",
"53": "Drizzle",
"55": "Drizzle",
"56": "Freezing drizzle",
"57": "Freezing drizzle",
"61": "Light rain",
"63": "Rain",
"65": "Heavy rain",
"66": "Light rain",
"67": "Heavy rain",
"71": "Light snow",
"73": "Snow",
"75": "Heavy snow",
"77": "Snow",
"80": "Light rain",
"81": "Rain",
"82": "Heavy rain",
"85": "Light snow showers",
"86": "Heavy snow showers",
"95": "Thunderstorm",
"96": "Thunderstorm with hail",
"99": "Thunderstorm with hail"
}
return conditions[String(code)] || "Unknown"
}
function formatTime(isoString) {
if (!isoString) return "--"