From b4f97aadf1cabb4aab383bbc3327b969db6bc775 Mon Sep 17 00:00:00 2001 From: Riley Testut Date: Mon, 4 Oct 2021 17:59:41 -0700 Subject: [PATCH] [AltWidget] Fixes app name appearing very small on iOS 15 Also improves layout on smaller devices, such as the iPhone 12/13 mini. --- AltWidget/WidgetView.swift | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/AltWidget/WidgetView.swift b/AltWidget/WidgetView.swift index 8099cf70..51756c4a 100644 --- a/AltWidget/WidgetView.swift +++ b/AltWidget/WidgetView.swift @@ -25,7 +25,7 @@ struct WidgetView : View GeometryReader { (geometry) in Group { - VStack(alignment: .leading) { + VStack(alignment: .leading) { VStack(alignment: .leading, spacing: 5) { let imageHeight = geometry.size.height * 0.45 @@ -41,8 +41,11 @@ struct WidgetView : View .lineLimit(1) .minimumScaleFactor(0.5) } + .fixedSize(horizontal: false, vertical: true) - HStack(alignment: .bottom) { + Spacer(minLength: 0) + + HStack(alignment: .center) { let expirationText: Text = { switch daysRemaining { @@ -56,7 +59,7 @@ struct WidgetView : View Text("Expires in\n") .font(.system(size: 13, weight: .semibold, design: .rounded)) .foregroundColor(Color.white.opacity(0.45)) + - + expirationText .font(.system(size: 15, weight: .semibold, design: .rounded)) .foregroundColor(.white) @@ -79,11 +82,10 @@ struct WidgetView : View .offset(x: 5) } } - .offset(y: 5) // Offset so we don't affect layout, but still leave space between app name and Countdown. + .fixedSize(horizontal: false, vertical: true) } - .frame(maxWidth: .infinity, maxHeight: .infinity) + .padding() } - .padding() } } else