Skip to content

Commit

Permalink
Removing list row separator for macOS Sonoma
Browse files Browse the repository at this point in the history
  • Loading branch information
DamascenoRafael committed Sep 30, 2023
1 parent 4e2a2ea commit 355cf5e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions reminders-menubar/Views/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ struct ContentView: View {
UpcomingRemindersContent()
}
.modifier(ListSectionSpacing())
.modifier(ListRowSeparatorHidden())
}
ForEach(remindersData.filteredReminderLists) { reminderList in
Section(header: CalendarTitle(calendar: reminderList.calendar)) {
Expand All @@ -38,6 +39,7 @@ struct ContentView: View {
}
}
.modifier(ListSectionSpacing())
.modifier(ListRowSeparatorHidden())
}
}
.listStyle(.plain)
Expand Down Expand Up @@ -67,6 +69,17 @@ struct ListSectionSpacing: ViewModifier {
}
}

struct ListRowSeparatorHidden: ViewModifier {
func body(content: Content) -> some View {
if #available(macOS 14.0, *) {
content
.listRowSeparator(.hidden)
} else {
content
}
}
}

struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView().environmentObject(RemindersData())
Expand Down

0 comments on commit 355cf5e

Please sign in to comment.