mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 12:07:55 +00:00
Add more flexible background support to FullscreenDialog (#2675)
Hide the background when the main content extends underneath the bottom content.
This commit is contained in:
@@ -55,7 +55,7 @@ struct AppLockScreen: View {
|
||||
.font(.compound.bodyMDSemibold)
|
||||
}
|
||||
.background()
|
||||
.environment(\.backgroundStyle, AnyShapeStyle(Color.compound.bgCanvasDefault))
|
||||
.backgroundStyle(.compound.bgCanvasDefault)
|
||||
.disabled(context.viewState.forcedLogoutIndicator != nil)
|
||||
.overlay {
|
||||
context.viewState.forcedLogoutIndicator.map(UserIndicatorModalView.init)
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ struct ServerConfirmationScreen: View {
|
||||
buttons
|
||||
}
|
||||
.background()
|
||||
.environment(\.backgroundStyle, AnyShapeStyle(Color.compound.bgCanvasDefault))
|
||||
.backgroundStyle(.compound.bgCanvasDefault)
|
||||
.introspect(.window, on: .supportedVersions) { window in
|
||||
context.send(viewAction: .updateWindow(window))
|
||||
}
|
||||
|
||||
+2
-2
@@ -21,13 +21,13 @@ struct AnalyticsPromptScreen: View {
|
||||
@ObservedObject var context: AnalyticsPromptScreenViewModel.Context
|
||||
|
||||
var body: some View {
|
||||
FullscreenDialog(topPadding: UIConstants.startScreenBreakerScreenTopPadding, showBackgroundGradient: true) {
|
||||
FullscreenDialog(topPadding: UIConstants.startScreenBreakerScreenTopPadding, background: .gradient) {
|
||||
mainContent
|
||||
} bottomContent: {
|
||||
buttons
|
||||
}
|
||||
.background()
|
||||
.environment(\.backgroundStyle, AnyShapeStyle(Color.compound.bgCanvasDefault))
|
||||
.backgroundStyle(.compound.bgCanvasDefault)
|
||||
.navigationBarHidden(true)
|
||||
.navigationBarBackButtonHidden(true)
|
||||
.interactiveDismissDisabled()
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ struct IdentityConfirmationScreen: View {
|
||||
actionButtons
|
||||
}
|
||||
.background()
|
||||
.environment(\.backgroundStyle, AnyShapeStyle(Color.compound.bgCanvasDefault))
|
||||
.backgroundStyle(.compound.bgCanvasDefault)
|
||||
.navigationBarHidden(true)
|
||||
.navigationBarBackButtonHidden(true)
|
||||
.interactiveDismissDisabled()
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ struct IdentityConfirmedScreen: View {
|
||||
actionButtons
|
||||
}
|
||||
.background()
|
||||
.environment(\.backgroundStyle, AnyShapeStyle(Color.compound.bgCanvasDefault))
|
||||
.backgroundStyle(.compound.bgCanvasDefault)
|
||||
.navigationBarHidden(true)
|
||||
.navigationBarBackButtonHidden(true)
|
||||
.interactiveDismissDisabled()
|
||||
|
||||
+2
-2
@@ -21,13 +21,13 @@ struct NotificationPermissionsScreen: View {
|
||||
@ObservedObject var context: NotificationPermissionsScreenViewModel.Context
|
||||
|
||||
var body: some View {
|
||||
FullscreenDialog(topPadding: UIConstants.startScreenBreakerScreenTopPadding, showBackgroundGradient: true) {
|
||||
FullscreenDialog(topPadding: UIConstants.startScreenBreakerScreenTopPadding, background: .gradient) {
|
||||
mainContent
|
||||
} bottomContent: {
|
||||
buttons
|
||||
}
|
||||
.background()
|
||||
.environment(\.backgroundStyle, AnyShapeStyle(Color.compound.bgCanvasDefault))
|
||||
.backgroundStyle(.compound.bgCanvasDefault)
|
||||
.navigationBarHidden(true)
|
||||
.navigationBarBackButtonHidden(true)
|
||||
.interactiveDismissDisabled()
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ struct SessionVerificationScreen: View {
|
||||
actionButtons
|
||||
}
|
||||
.background()
|
||||
.environment(\.backgroundStyle, AnyShapeStyle(Color.compound.bgCanvasDefault))
|
||||
.backgroundStyle(.compound.bgCanvasDefault)
|
||||
.interactiveDismissDisabled()
|
||||
}
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ struct PlaceholderScreen: View {
|
||||
}
|
||||
}
|
||||
.background()
|
||||
.environment(\.backgroundStyle, AnyShapeStyle(Color.compound.bgCanvasDefault))
|
||||
.backgroundStyle(.compound.bgCanvasDefault)
|
||||
.ignoresSafeArea(edges: .top) // Remain vertically centred even if there's a navigation bar.
|
||||
.ignoresSafeArea(.keyboard) // Specifically for the lock screen, but make sense everywhere.
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ struct QRCodeLoginScreen: View {
|
||||
.toolbar { toolbar }
|
||||
.toolbar(.visible, for: .navigationBar)
|
||||
.background()
|
||||
.environment(\.backgroundStyle, AnyShapeStyle(Color.compound.bgSubtleSecondary))
|
||||
.backgroundStyle(.compound.bgSubtleSecondary)
|
||||
.interactiveDismissDisabled()
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ struct ResetRecoveryKeyScreen: View {
|
||||
.toolbar { toolbar }
|
||||
.toolbar(.visible, for: .navigationBar)
|
||||
.background()
|
||||
.environment(\.backgroundStyle, AnyShapeStyle(Color.compound.bgSubtleSecondary))
|
||||
.backgroundStyle(.compound.bgSubtleSecondary)
|
||||
.interactiveDismissDisabled()
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ struct SecureBackupKeyBackupScreen: View {
|
||||
.buttonStyle(.compound(.primary))
|
||||
}
|
||||
.background()
|
||||
.environment(\.backgroundStyle, AnyShapeStyle(Color.compound.bgCanvasDefault))
|
||||
.backgroundStyle(.compound.bgCanvasDefault)
|
||||
.interactiveDismissDisabled()
|
||||
.toolbar { toolbar }
|
||||
.alert(item: $context.alertInfo)
|
||||
|
||||
+1
-1
@@ -33,7 +33,7 @@ struct SecureBackupLogoutConfirmationScreen: View {
|
||||
}
|
||||
.toolbar { toolbar }
|
||||
.background()
|
||||
.environment(\.backgroundStyle, AnyShapeStyle(Color.compound.bgCanvasDefault))
|
||||
.backgroundStyle(.compound.bgCanvasDefault)
|
||||
.alert(item: $context.alertInfo)
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -39,7 +39,7 @@ struct SecureBackupRecoveryKeyScreen: View {
|
||||
.toolbar { toolbar }
|
||||
.toolbar(.visible, for: .navigationBar)
|
||||
.background()
|
||||
.environment(\.backgroundStyle, AnyShapeStyle(Color.compound.bgCanvasDefault))
|
||||
.backgroundStyle(.compound.bgCanvasDefault)
|
||||
.interactiveDismissDisabled()
|
||||
.alert(item: $context.alertInfo)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user