mirror of
https://github.com/FBukovina/Atoll.git
synced 2026-10-27 15:14:33 +00:00
Fix: Added scroll shadow in presets and event scroll
This commit is contained in:
parent
34e435b400
commit
1b24e042de
2 changed files with 56 additions and 28 deletions
|
|
@ -296,27 +296,41 @@ struct EventListView: View {
|
||||||
|
|
||||||
var body: some View {
|
var body: some View {
|
||||||
ScrollViewReader { proxy in
|
ScrollViewReader { proxy in
|
||||||
List {
|
ZStack {
|
||||||
ForEach(filteredEvents) { event in
|
List {
|
||||||
Button(action: {
|
ForEach(filteredEvents) { event in
|
||||||
if let url = event.calendarAppURL() {
|
Button(action: {
|
||||||
openURL(url)
|
if let url = event.calendarAppURL() {
|
||||||
|
openURL(url)
|
||||||
|
}
|
||||||
|
}) {
|
||||||
|
eventRow(event)
|
||||||
}
|
}
|
||||||
}) {
|
.id(event.id)
|
||||||
eventRow(event)
|
.padding(.leading, -5)
|
||||||
|
.buttonStyle(PlainButtonStyle())
|
||||||
|
.listRowSeparator(.automatic)
|
||||||
|
.listRowSeparatorTint(.gray.opacity(0.2))
|
||||||
|
.listRowBackground(Color.clear)
|
||||||
}
|
}
|
||||||
.id(event.id)
|
|
||||||
.padding(.leading, -5)
|
|
||||||
.buttonStyle(PlainButtonStyle())
|
|
||||||
.listRowSeparator(.automatic)
|
|
||||||
.listRowSeparatorTint(.gray.opacity(0.2))
|
|
||||||
.listRowBackground(Color.clear)
|
|
||||||
}
|
}
|
||||||
|
.listStyle(.plain)
|
||||||
|
.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)
|
||||||
}
|
}
|
||||||
.listStyle(.plain)
|
|
||||||
.scrollIndicators(.never)
|
|
||||||
.scrollContentBackground(.hidden)
|
|
||||||
.background(Color.clear)
|
|
||||||
.onAppear {
|
.onAppear {
|
||||||
scrollToRelevantEvent(proxy: proxy)
|
scrollToRelevantEvent(proxy: proxy)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,20 +99,34 @@ struct NotchTimerView: View {
|
||||||
} else {
|
} else {
|
||||||
let computedHeight = CGFloat(timerPresets.count) * 60 + 4
|
let computedHeight = CGFloat(timerPresets.count) * 60 + 4
|
||||||
let listHeight = min(max(0, maxTabContentHeight - 16), computedHeight)
|
let listHeight = min(max(0, maxTabContentHeight - 16), computedHeight)
|
||||||
List {
|
ZStack {
|
||||||
ForEach(timerPresets) { preset in
|
List {
|
||||||
TimerPresetCard(preset: preset, isActive: timerManager.activePresetId == preset.id) {
|
ForEach(timerPresets) { preset in
|
||||||
timerManager.startTimer(duration: preset.duration, name: preset.name, preset: preset)
|
TimerPresetCard(preset: preset, isActive: timerManager.activePresetId == preset.id) {
|
||||||
coordinator.currentView = .timer
|
timerManager.startTimer(duration: preset.duration, name: preset.name, preset: preset)
|
||||||
|
coordinator.currentView = .timer
|
||||||
|
}
|
||||||
|
.listRowInsets(EdgeInsets(top: 2, leading: 0, bottom: 2, trailing: 0))
|
||||||
|
.listRowBackground(Color.clear)
|
||||||
|
.listRowSeparator(.hidden)
|
||||||
}
|
}
|
||||||
.listRowInsets(EdgeInsets(top: 2, leading: 0, bottom: 2, trailing: 0))
|
|
||||||
.listRowBackground(Color.clear)
|
|
||||||
.listRowSeparator(.hidden)
|
|
||||||
}
|
}
|
||||||
|
.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)
|
||||||
}
|
}
|
||||||
.listStyle(.plain)
|
|
||||||
.scrollContentBackground(.hidden)
|
|
||||||
.scrollIndicators(.never)
|
|
||||||
.frame(height: listHeight)
|
.frame(height: listHeight)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue