From 948d40e82585f79c810f21ca379d1d2d2b321017 Mon Sep 17 00:00:00 2001 From: Garth Vander Houwen Date: Fri, 23 Aug 2024 19:12:07 -0700 Subject: [PATCH] Update weather --- .../Weather/LocalWeatherConditions.swift | 47 +++++++++++++------ 1 file changed, 33 insertions(+), 14 deletions(-) diff --git a/Meshtastic/Views/Helpers/Weather/LocalWeatherConditions.swift b/Meshtastic/Views/Helpers/Weather/LocalWeatherConditions.swift index 0f0ce860..3ea1dee3 100644 --- a/Meshtastic/Views/Helpers/Weather/LocalWeatherConditions.swift +++ b/Meshtastic/Views/Helpers/Weather/LocalWeatherConditions.swift @@ -95,12 +95,20 @@ struct WeatherConditionsCompactWidget: View { let description: String var body: some View { VStack(alignment: .leading) { - Label { Text(description) } icon: { Image(systemName: symbolName).symbolRenderingMode(.multicolor) } - .font(.caption) + HStack(spacing: 5.0) { + Image(systemName: symbolName) + .foregroundColor(.accentColor) + .font(.callout) + Text(description) + .lineLimit(2) + .allowsTightening(/*@START_MENU_TOKEN@*/true/*@END_MENU_TOKEN@*/) + .fixedSize(horizontal: false, vertical: true) + .font(.caption) + } Text(temperature) - .font(temperature.length < 4 ? .system(size: 80) : .system(size: 60) ) + .font(temperature.length < 4 ? .system(size: 76) : .system(size: 60) ) } - .frame(minWidth: 100, idealWidth: 125, maxWidth: 150, minHeight: 130, idealHeight: 140, maxHeight: 150) + .frame(minWidth: 100, idealWidth: 125, maxWidth: 150, minHeight: 120, idealHeight: 130, maxHeight: 140) .padding() .background(.tertiary, in: RoundedRectangle(cornerRadius: 20, style: .continuous)) } @@ -111,17 +119,23 @@ struct HumidityCompactWidget: View { let dewPoint: String var body: some View { VStack(alignment: .leading) { - Label { Text("HUMIDITY") } icon: { Image(systemName: "humidity").symbolRenderingMode(.multicolor) } - .font(.caption) + HStack(spacing: 5.0) { + Image(systemName: "humidity") + .foregroundColor(.accentColor) + .font(.callout) + Text("HUMIDITY") + .font(.caption) + } Text("\(humidity)%") .font(.largeTitle) - .padding(.bottom) + .padding(.bottom, 5) Text("The dew point is \(dewPoint) right now.") .lineLimit(3) + .allowsTightening(/*@START_MENU_TOKEN@*/true/*@END_MENU_TOKEN@*/) .fixedSize(horizontal: false, vertical: true) - .font(.caption) + .font(.caption2) } - .frame(minWidth: 100, idealWidth: 125, maxWidth: 150, minHeight: 130, idealHeight: 140, maxHeight: 150) + .frame(minWidth: 100, idealWidth: 125, maxWidth: 150, minHeight: 120, idealHeight: 130, maxHeight: 140) .padding() .background(.tertiary, in: RoundedRectangle(cornerRadius: 20, style: .continuous)) } @@ -133,15 +147,20 @@ struct PressureCompactWidget: View { let low: Bool var body: some View { VStack(alignment: .leading) { - Label { Text("PRESSURE") } icon: { Image(systemName: "gauge").symbolRenderingMode(.multicolor) } - .font(.caption) + HStack(spacing: 5.0) { + Image(systemName: "gauge") + .foregroundColor(.accentColor) + .font(.callout) + Text("PRESSURE") + .font(.caption) + } Text(pressure) .font(pressure.length < 7 ? .system(size: 35) : .system(size: 30) ) Text(low ? "LOW" : "HIGH") - .padding(.bottom) + .padding(.bottom, 10) Text(unit) } - .frame(minWidth: 100, idealWidth: 125, maxWidth: 150, minHeight: 130, idealHeight: 140, maxHeight: 150) + .frame(minWidth: 100, idealWidth: 125, maxWidth: 150, minHeight: 120, idealHeight: 130, maxHeight: 140) .padding() .background(.tertiary, in: RoundedRectangle(cornerRadius: 20, style: .continuous)) } @@ -163,7 +182,7 @@ struct WindCompactWidget: View { Text("Gusts \(gust)") } } - .frame(minWidth: 100, idealWidth: 125, maxWidth: 150, minHeight: 130, idealHeight: 140, maxHeight: 150) + .frame(minWidth: 100, idealWidth: 125, maxWidth: 150, minHeight: 120, idealHeight: 130, maxHeight: 140) .padding() .background(.tertiary, in: RoundedRectangle(cornerRadius: 20, style: .continuous)) }