mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Add an app setting to disable rendering the chrome around the app logo/brand.
This commit is contained in:
committed by
Stefan Ceriu
parent
ab41783c4d
commit
94db3adf3a
@@ -8,26 +8,26 @@
|
||||
import SwiftUI
|
||||
|
||||
class PlaceholderScreenCoordinator: CoordinatorProtocol {
|
||||
private let showsBackgroundGradient: Bool
|
||||
private let hideBrandChrome: Bool
|
||||
|
||||
init(showsBackgroundGradient: Bool = false) {
|
||||
self.showsBackgroundGradient = showsBackgroundGradient
|
||||
init(hideBrandChrome: Bool = true) {
|
||||
self.hideBrandChrome = hideBrandChrome
|
||||
}
|
||||
|
||||
func toPresentable() -> AnyView {
|
||||
AnyView(PlaceholderScreen(showsBackgroundGradient: showsBackgroundGradient))
|
||||
AnyView(PlaceholderScreen(hideBrandChrome: hideBrandChrome))
|
||||
}
|
||||
}
|
||||
|
||||
/// The screen shown in split view when the detail has no content.
|
||||
struct PlaceholderScreen: View {
|
||||
let showsBackgroundGradient: Bool
|
||||
let hideBrandChrome: Bool
|
||||
|
||||
var body: some View {
|
||||
AuthenticationStartLogo(isOnGradient: showsBackgroundGradient)
|
||||
AuthenticationStartLogo(isOnGradient: !hideBrandChrome)
|
||||
.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
.background {
|
||||
if showsBackgroundGradient {
|
||||
if !hideBrandChrome {
|
||||
AuthenticationStartScreenBackgroundImage()
|
||||
}
|
||||
}
|
||||
@@ -40,10 +40,10 @@ struct PlaceholderScreen: View {
|
||||
|
||||
struct PlaceholderScreen_Previews: PreviewProvider, TestablePreview {
|
||||
static var previews: some View {
|
||||
PlaceholderScreen(showsBackgroundGradient: false)
|
||||
PlaceholderScreen(hideBrandChrome: true)
|
||||
.previewDisplayName("Screen")
|
||||
|
||||
PlaceholderScreen(showsBackgroundGradient: true)
|
||||
PlaceholderScreen(hideBrandChrome: false)
|
||||
.previewDisplayName("With background")
|
||||
|
||||
NavigationSplitView {
|
||||
@@ -53,7 +53,7 @@ struct PlaceholderScreen_Previews: PreviewProvider, TestablePreview {
|
||||
}
|
||||
}
|
||||
} detail: {
|
||||
PlaceholderScreen(showsBackgroundGradient: false)
|
||||
PlaceholderScreen(hideBrandChrome: true)
|
||||
}
|
||||
.previewDisplayName("Split View")
|
||||
.previewInterfaceOrientation(.landscapeLeft)
|
||||
|
||||
Reference in New Issue
Block a user