diff options
Diffstat (limited to 'Sora/Views/Post/Grid')
| -rw-r--r-- | Sora/Views/Post/Grid/PostGridSearchHistoryView.swift | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift b/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift index e306839..30f7808 100644 --- a/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift +++ b/Sora/Views/Post/Grid/PostGridSearchHistoryView.swift @@ -6,6 +6,7 @@ struct PostGridSearchHistoryView: View { @State private var searchText: String = "" @Binding var selectedTab: Int @Binding var isPresented: Bool + @State private var isShowingRemoveAllConfirmation = false var filteredHistory: [BooruSearchQuery] { guard !searchText.isEmpty else { @@ -64,14 +65,28 @@ struct PostGridSearchHistoryView: View { } .onDelete(perform: settings.removeSearchHistoryEntry) } - #if os(macOS) - .listStyle(.plain) - #endif } } } .navigationTitle("Search History") .searchable(text: $searchText) + .toolbar { + ToolbarItem { + Button(action: { + isShowingRemoveAllConfirmation = true + }) { + Label("Remove All Search History", systemImage: "trash") + } + } + } + .confirmationDialog( + "Are you sure you want to remove all searches? This action cannot be undone.", + isPresented: $isShowingRemoveAllConfirmation + ) { + Button("Remove All Searches") { + settings.bookmarks.removeAll() + } + } } } |