Improve orientation and safe area handling

Fix #369
Fix #382
This commit is contained in:
Arkadiusz Fal
2023-05-20 16:04:58 +02:00
parent b53b5eac56
commit f67b1d4feb
14 changed files with 176 additions and 118 deletions

View File

@@ -18,13 +18,23 @@ struct ContentView: View {
var body: some View {
Group {
#if os(iOS)
if Constants.isIPhone {
AppTabNavigation()
} else {
if horizontalSizeClass == .compact {
AppTabNavigation()
} else {
AppSidebarNavigation()
GeometryReader { proxy in
Group {
if Constants.isIPhone {
AppTabNavigation()
} else {
if horizontalSizeClass == .compact {
AppTabNavigation()
} else {
AppSidebarNavigation()
}
}
}
.onAppear {
SafeAreaModel.shared.safeArea = proxy.safeAreaInsets
}
.onChange(of: proxy.safeAreaInsets) { newValue in
SafeAreaModel.shared.safeArea = newValue
}
}
#elseif os(macOS)