iOS: Fix toolbars disappearing when scrolling too far up
This commit is contained in:
parent
012ada4af7
commit
1449dc215b
|
@ -49,11 +49,16 @@ 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 delta != 0 {
|
if scrollOffset < 0 {
|
||||||
barOffset += delta
|
barOffset = 0
|
||||||
|
} else {
|
||||||
|
if delta != 0 {
|
||||||
|
barOffset += delta
|
||||||
|
}
|
||||||
|
|
||||||
|
print(barOffset)
|
||||||
|
barOffset = max(0, min(navBarHeight + outer.safeAreaInsets.top, barOffset))
|
||||||
}
|
}
|
||||||
|
|
||||||
barOffset = max(0, min(navBarHeight + outer.safeAreaInsets.top, barOffset))
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +68,7 @@ struct ContentView: View {
|
||||||
Color.clear.preference(key: NavBarHeightPrefKey.self, value: geom.frame(in: .global).height)
|
Color.clear.preference(key: NavBarHeightPrefKey.self, value: geom.frame(in: .global).height)
|
||||||
})
|
})
|
||||||
.offset(y: -barOffset)
|
.offset(y: -barOffset)
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
ToolBar(navigator: navigator, shareCurrentURL: shareCurrentURL)
|
ToolBar(navigator: navigator, shareCurrentURL: shareCurrentURL)
|
||||||
|
|
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue