diff options
| author | ivar <i@oiee.no> | 2026-03-23 17:19:08 +0100 |
|---|---|---|
| committer | ivar <i@oiee.no> | 2026-03-23 17:19:08 +0100 |
| commit | cf4a0410cb760f5ceccdb3edc2d9a1a96c718b43 (patch) | |
| tree | dbeba8ede84d577ac0979b8d36a7c4459f984d39 /Solsnu.Widget/Solsnu_WidgetBundle.swift | |
| parent | ffc55beb528c54c7a201a78849149355a5c2d448 (diff) | |
| download | solverv-cf4a0410cb760f5ceccdb3edc2d9a1a96c718b43.tar.xz solverv-cf4a0410cb760f5ceccdb3edc2d9a1a96c718b43.zip | |
feat: add medium and large widget configurations
Diffstat (limited to 'Solsnu.Widget/Solsnu_WidgetBundle.swift')
| -rw-r--r-- | Solsnu.Widget/Solsnu_WidgetBundle.swift | 45 |
1 files changed, 44 insertions, 1 deletions
diff --git a/Solsnu.Widget/Solsnu_WidgetBundle.swift b/Solsnu.Widget/Solsnu_WidgetBundle.swift index 24e5cbe..8a7b718 100644 --- a/Solsnu.Widget/Solsnu_WidgetBundle.swift +++ b/Solsnu.Widget/Solsnu_WidgetBundle.swift @@ -12,6 +12,49 @@ import SwiftUI struct Solsnu_WidgetBundle: WidgetBundle { var body: some Widget { Solsnu_Widget() - Solsnu_WidgetControl() + Solsnu_WidgetMedium() + Solsnu_WidgetLarge() + } +} + +// Medium widget +struct Solsnu_WidgetMedium: Widget { + let kind: String = "Solsnu_Widget_Medium" + + var body: some WidgetConfiguration { + StaticConfiguration(kind: kind, provider: Provider()) { entry in + if #available(iOS 17.0, *) { + MediumWidgetView(entry: entry) + .containerBackground(.fill.tertiary, for: .widget) + } else { + MediumWidgetView(entry: entry) + .padding() + .background() + } + } + .configurationDisplayName("Solstice Countdown") + .description("Days until next solstice or equinox") + .supportedFamilies([.systemMedium]) + } +} + +// Large widget +struct Solsnu_WidgetLarge: Widget { + let kind: String = "Solsnu_Widget_Large" + + var body: some WidgetConfiguration { + StaticConfiguration(kind: kind, provider: Provider()) { entry in + if #available(iOS 17.0, *) { + LargeWidgetView(entry: entry) + .containerBackground(.fill.tertiary, for: .widget) + } else { + LargeWidgetView(entry: entry) + .padding() + .background() + } + } + .configurationDisplayName("Solstice Countdown") + .description("Days until next solstice or equinox") + .supportedFamilies([.systemLarge]) } } |
