iOS: Fix toolbars disappearing when scrolling too far up

This commit is contained in:
Shadowfacts 2020-09-29 15:29:58 -04:00
parent 012ada4af7
commit 1449dc215b
Signed by: shadowfacts
GPG Key ID: 94A5AB95422746E5
2 changed files with 11 additions and 6 deletions

View File

@ -49,13 +49,18 @@ struct ContentView: View {
// It's not actually user scrolling, and this screws up our animation, so we ignore it. // It's not actually user scrolling, and this screws up our animation, so we ignore it.
guard abs(delta) != outer.safeAreaInsets.top else { return } guard abs(delta) != outer.safeAreaInsets.top else { return }
if scrollOffset < 0 {
barOffset = 0
} else {
if delta != 0 { if delta != 0 {
barOffset += delta barOffset += delta
} }
print(barOffset)
barOffset = max(0, min(navBarHeight + outer.safeAreaInsets.top, barOffset)) barOffset = max(0, min(navBarHeight + outer.safeAreaInsets.top, barOffset))
} }
} }
}
VStack(spacing: 0) { VStack(spacing: 0) {
NavigationBar(navigator: navigator) NavigationBar(navigator: navigator)

View File

@ -59,7 +59,7 @@
<EnvironmentVariable <EnvironmentVariable
key = "DEFAULT_URL" key = "DEFAULT_URL"
value = "gemini://drewdevault.com" value = "gemini://drewdevault.com"
isEnabled = "YES"> isEnabled = "NO">
</EnvironmentVariable> </EnvironmentVariable>
</EnvironmentVariables> </EnvironmentVariables>
</LaunchAction> </LaunchAction>