Add inline Add Source button to Sources settings on macOS

This commit is contained in:
Arkadiusz Fal
2026-04-21 06:27:31 +02:00
parent 111c3d7360
commit 3afd0bdf78

View File

@@ -74,7 +74,7 @@ struct SourcesListView: View {
#if os(iOS) #if os(iOS)
.navigationBarTitleDisplayMode(.inline) .navigationBarTitleDisplayMode(.inline)
#endif #endif
#if !os(tvOS) #if os(iOS)
.toolbar { .toolbar {
ToolbarItem(placement: .primaryAction) { ToolbarItem(placement: .primaryAction) {
Button { Button {
@@ -156,6 +156,20 @@ struct SourcesListView: View {
.overlay( .overlay(
ScrollView { ScrollView {
LazyVStack(spacing: 0) { LazyVStack(spacing: 0) {
#if os(macOS)
HStack {
Spacer()
Button {
showingAddSheet = true
} label: {
Label(String(localized: "sources.addSource"), systemImage: "plus")
}
.help(String(localized: "sources.addSource"))
.accessibilityIdentifier("sources.addButton")
}
.padding(.horizontal, 16)
.padding(.vertical, 8)
#endif
remoteServersSection remoteServersSection
fileSourcesSection fileSourcesSection
} }