diff --git a/Airship/AirshipCore/Source/LabelButton.swift b/Airship/AirshipCore/Source/LabelButton.swift index 1d5fb8922..c23b68aed 100644 --- a/Airship/AirshipCore/Source/LabelButton.swift +++ b/Airship/AirshipCore/Source/LabelButton.swift @@ -24,6 +24,7 @@ struct LabelButton : View { actions: self.model.actions ) { Label(model: self.model.label, constraints: constraints) + .padding(self.model.border?.strokeWidth ?? 0) .constraints(constraints, fixedSize: true) .applyIf(self.constraints.height == nil) { view in view.padding([.bottom, .top], 12) diff --git a/Airship/AirshipCore/Source/ModalView.swift b/Airship/AirshipCore/Source/ModalView.swift index 47e8a04cf..48c66d7cb 100644 --- a/Airship/AirshipCore/Source/ModalView.swift +++ b/Airship/AirshipCore/Source/ModalView.swift @@ -156,25 +156,34 @@ struct ModalView: View { @ViewBuilder private func modalBackground(_ placement: ModalPlacement) -> some View { - if placement.isFullScreen() && placement.ignoreSafeArea != true { - Rectangle() - .foregroundColor(statusBarShimColor()) - .edgesIgnoringSafeArea(.all) - - } else { - Rectangle() - .foreground(placement.shade) - .edgesIgnoringSafeArea(.all) - .applyIf(self.presentation.dismissOnTouchOutside == true) { - view in - // Add tap gesture outside of view to dismiss - view.addTapGesture { - self.thomasEnvironment.dismiss() + GeometryReader { reader in + VStack(spacing: 0) { + if placement.isFullscreen, placement.ignoreSafeArea != true { + statusBarShimColor() + .frame(height: reader.safeAreaInsets.top) + } + + Rectangle() + .foreground(placement.shade) + .edgesIgnoringSafeArea(.all) + .applyIf(self.presentation.dismissOnTouchOutside == true) { + view in + // Add tap gesture outside of view to dismiss + view.addTapGesture { + self.thomasEnvironment.dismiss() + } } + + if placement.isFullscreen, placement.ignoreSafeArea != true { + statusBarShimColor() + .frame(height: reader.safeAreaInsets.bottom) } + } + .edgesIgnoringSafeArea(.all) } } + private func resolvePlacement( orientation: Orientation, windowSize: WindowSize @@ -242,7 +251,7 @@ struct ModalView: View { extension ModalPlacement { - fileprivate func isFullScreen() -> Bool { + fileprivate var isFullscreen: Bool { if let horiztonalMargins = self.margin?.horiztonalMargins, horiztonalMargins > 0 { return false }