Skip to content

Commit a40956b

Browse files
committed
Fix New Tab Bar Dock
1 parent 87f7385 commit a40956b

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

StikJIT/Views/MainTabView.swift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ fileprivate struct FavoritesDockView: View {
6363
@Binding var selection: Int
6464
let accentColor: Color
6565
let progress: CGFloat
66+
let bottomPadding: CGFloat
6667

6768
var body: some View {
6869
let fade = 1 - smoothstep(progress, 0.30, 0.55)
@@ -84,6 +85,7 @@ fileprivate struct FavoritesDockView: View {
8485
Spacer()
8586
}
8687
.padding(.vertical, 10)
88+
.padding(.bottom, bottomPadding)
8789
.opacity(fade)
8890
.offset(y: yLift)
8991
.animation(drawerSpring, value: progress)
@@ -105,6 +107,7 @@ fileprivate struct AppGridView: View {
105107
var body: some View {
106108
let fade = smoothstep(progress, 0.45, 0.75)
107109
let yRise: CGFloat = 14 * (1 - fade)
110+
108111
ScrollView {
109112
LazyVGrid(columns: Self.columns, spacing: 16) {
110113
ForEach(items.indices, id: \.self) { i in
@@ -161,6 +164,8 @@ fileprivate struct AppGridView: View {
161164
}
162165
.padding()
163166
}
167+
.scrollDisabled(true)
168+
.scrollIndicators(.hidden)
164169
.opacity(fade)
165170
.offset(y: yRise)
166171
.animation(drawerSpring, value: progress)
@@ -231,10 +236,13 @@ struct AppDrawer: View {
231236
GeometryReader { geo in
232237
let safeBottom = geo.safeAreaInsets.bottom
233238
let totalHeight = maxHeight + safeBottom
234-
let closedY = geo.size.height - minHeight - safeBottom
239+
let dockClearance: CGFloat = safeBottom + 16
240+
let closedY = geo.size.height - minHeight - safeBottom - dockClearance
235241
let openY = geo.size.height - totalHeight
236242
let travel = closedY - openY
237243
let offsetY = closedY - progress * travel
244+
let dockBottomPadding = safeBottom + 8
245+
238246
ZStack {
239247
if progress > 0 {
240248
Color.clear
@@ -253,7 +261,8 @@ struct AppDrawer: View {
253261
FavoritesDockView(favorites: favorites,
254262
selection: $selection,
255263
accentColor: accentColor,
256-
progress: progress)
264+
progress: progress,
265+
bottomPadding: dockBottomPadding)
257266
.padding(.top, 10)
258267
AppGridView(items: items,
259268
selection: $selection,

0 commit comments

Comments
 (0)