Fix: Added scroll shadow in presets and event scroll

This commit is contained in:
Hariharan Mudaliar 2025-12-11 00:23:42 +05:30
commit 1b24e042de
No known key found for this signature in database
GPG key ID: D04F1C2B9194DDFC
2 changed files with 56 additions and 28 deletions

View file

@ -296,6 +296,7 @@ struct EventListView: View {
var body: some View {
ScrollViewReader { proxy in
ZStack {
List {
ForEach(filteredEvents) { event in
Button(action: {
@ -317,6 +318,19 @@ struct EventListView: View {
.scrollIndicators(.never)
.scrollContentBackground(.hidden)
.background(Color.clear)
LinearGradient(colors: [Color.black.opacity(0.65), .clear], startPoint: .top, endPoint: .bottom)
.frame(height: 16)
.allowsHitTesting(false)
.alignmentGuide(.top) { d in d[.top] }
.frame(maxHeight: .infinity, alignment: .top)
LinearGradient(colors: [.clear, Color.black.opacity(0.65)], startPoint: .top, endPoint: .bottom)
.frame(height: 16)
.allowsHitTesting(false)
.alignmentGuide(.bottom) { d in d[.bottom] }
.frame(maxHeight: .infinity, alignment: .bottom)
}
.onAppear {
scrollToRelevantEvent(proxy: proxy)
}

View file

@ -99,6 +99,7 @@ struct NotchTimerView: View {
} else {
let computedHeight = CGFloat(timerPresets.count) * 60 + 4
let listHeight = min(max(0, maxTabContentHeight - 16), computedHeight)
ZStack {
List {
ForEach(timerPresets) { preset in
TimerPresetCard(preset: preset, isActive: timerManager.activePresetId == preset.id) {
@ -113,6 +114,19 @@ struct NotchTimerView: View {
.listStyle(.plain)
.scrollContentBackground(.hidden)
.scrollIndicators(.never)
LinearGradient(colors: [Color.black.opacity(0.65), .clear], startPoint: .top, endPoint: .bottom)
.frame(height: 16)
.allowsHitTesting(false)
.alignmentGuide(.top) { d in d[.top] }
.frame(maxHeight: .infinity, alignment: .top)
LinearGradient(colors: [.clear, Color.black.opacity(0.65)], startPoint: .top, endPoint: .bottom)
.frame(height: 16)
.allowsHitTesting(false)
.alignmentGuide(.bottom) { d in d[.bottom] }
.frame(maxHeight: .infinity, alignment: .bottom)
}
.frame(height: listHeight)
}
}