diff options
| author | ivar <i@oiee.no> | 2026-03-24 12:34:45 +0100 |
|---|---|---|
| committer | ivar <i@oiee.no> | 2026-03-24 12:34:45 +0100 |
| commit | 4a7ddc2897d1718a7f2f3a3b42f753803676815d (patch) | |
| tree | d0f925315dc1e123fee383ce9d5f3460934fd31c | |
| parent | 17ec71ada86cde7e4dcfdbc20cb0d59b18aa4e34 (diff) | |
| download | solverv-4a7ddc2897d1718a7f2f3a3b42f753803676815d.tar.xz solverv-4a7ddc2897d1718a7f2f3a3b42f753803676815d.zip | |
feat: display sunrise/sunset times in medium widget
| -rw-r--r-- | Solsnu.Widget/Views/MediumWidgetView.swift | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Solsnu.Widget/Views/MediumWidgetView.swift b/Solsnu.Widget/Views/MediumWidgetView.swift index 6f1c8e9..69bbbe2 100644 --- a/Solsnu.Widget/Views/MediumWidgetView.swift +++ b/Solsnu.Widget/Views/MediumWidgetView.swift @@ -6,11 +6,6 @@ struct MediumWidgetView: View { var body: some View { HStack(spacing: 12) { - // Left: Emoji - Text(entry.emoji) - .font(.system(size: 60)) - - // Right: Info VStack(alignment: .leading, spacing: 8) { Text("Season Event") .font(.headline) @@ -21,6 +16,16 @@ struct MediumWidgetView: View { ProgressView(value: Double(entry.def.progressRatio())) + if !entry.def.sunriseFormatted.isEmpty && !entry.def.sunsetFormatted.isEmpty { + HStack { + Text("Sunrise: \(entry.def.sunriseFormatted)") + Spacer() + Text("Sunset: \(entry.def.sunsetFormatted)") + } + .font(.system(size: 12, weight: .regular)) + .foregroundStyle(Color(red: 0.152, green: 0.136, blue: 0.056)) + } + Spacer() } @@ -30,7 +35,3 @@ struct MediumWidgetView: View { } } -#Preview { - let entry = SolvervEntry(def: SolvervDef(utcString: "2026-12-21 20:50:00")) - MediumWidgetView(entry: entry) -} |
