Transparent logo in version screen (#963)

Looks better on macOS and allows gradient on tvOS.
This commit is contained in:
Davide 2024-11-28 22:59:37 +01:00 committed by GitHub
parent e761979134
commit 63496725c8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 27 additions and 18 deletions

View File

@ -69,7 +69,6 @@ struct AboutContentView<LinkContent, AboutDestination, LogDestination>: View whe
}
}
}
.background(navigationRoute == .version ? theme.primaryColor : nil)
.onLoad {
navigationRoute = .version
}

View File

@ -80,7 +80,7 @@ struct ProfileView: View, Routable, TunnelInstallationProviding {
}
}
.ignoresSafeArea(edges: .horizontal)
.background(theme.primaryColor)
.background(theme.primaryGradient)
.themeAnimation(on: showsSidePanel, category: .profiles)
.defaultFocus($focusedField, .switchProfile)
.onChange(of: tunnel.status, onTunnelStatus)

View File

@ -63,7 +63,7 @@ struct SettingsView: View {
DetailView(detail: detail)
.frame(maxWidth: .infinity)
}
.background(theme.primaryColor)
.background(theme.primaryGradient)
.onChange(of: focus) {
guard focus != nil else {
return

View File

@ -34,11 +34,11 @@ extension Theme {
secondaryWeight = .light
}
// public var primaryGradient: AnyGradient {
// primaryColor
// .opacity(0.6)
// .gradient
// }
public var primaryGradient: AnyGradient {
primaryColor
.opacity(0.6)
.gradient
}
}
// MARK: - Shortcuts

View File

@ -40,6 +40,26 @@ public struct VersionView<Icon>: View where Icon: View {
public var body: some View {
ScrollView {
contentView
}
#if os(iOS)
.background(theme.primaryColor)
.foregroundStyle(.white)
#endif
}
}
extension VersionView where Icon == LogoImage {
public init() {
icon = {
LogoImage()
}
}
}
private extension VersionView {
var contentView: some View {
Group {
icon()
.padding(.top)
Spacer()
@ -54,16 +74,6 @@ public struct VersionView<Icon>: View where Icon: View {
.padding()
}
}
.background(theme.primaryColor)
.foregroundStyle(.white)
}
}
extension VersionView where Icon == LogoImage {
public init() {
icon = {
LogoImage()
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB