diff options
| author | Fuwn <[email protected]> | 2025-03-02 04:59:00 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-03-02 04:59:00 -0800 |
| commit | ec6f6e766b878ec7f11f4f404570768c37486ad5 (patch) | |
| tree | 45cbf47f3f7b9ee48f50fd1649ea46b09bebda6b /Sora/Views/BookmarksView.swift | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-ec6f6e766b878ec7f11f4f404570768c37486ad5.tar.xz sora-testing-ec6f6e766b878ec7f11f4f404570768c37486ad5.zip | |
feat: Development commit
Diffstat (limited to 'Sora/Views/BookmarksView.swift')
| -rw-r--r-- | Sora/Views/BookmarksView.swift | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/Sora/Views/BookmarksView.swift b/Sora/Views/BookmarksView.swift index fa9ca5d..ccef3f1 100644 --- a/Sora/Views/BookmarksView.swift +++ b/Sora/Views/BookmarksView.swift @@ -5,6 +5,7 @@ struct BookmarksView: View { @EnvironmentObject var manager: BooruManager @Binding var selectedTab: Int @State private var bookmarksSearchText: String = "" + @State private var isShowingRemoveAllConfirmation = false var filteredBookmarks: [SettingsBookmark] { guard !bookmarksSearchText.isEmpty else { @@ -58,14 +59,28 @@ struct BookmarksView: View { } .onDelete(perform: settings.removeBookmark) } - #if os(macOS) - .listStyle(.plain) - #endif } } } .navigationTitle("Bookmarks") .searchable(text: $bookmarksSearchText) + .toolbar { + ToolbarItem { + Button(action: { + isShowingRemoveAllConfirmation = true + }) { + Label("Remove All Bookmarks", systemImage: "trash") + } + } + } + .confirmationDialog( + "Are you sure you want to remove all bookmarks? This action cannot be undone.", + isPresented: $isShowingRemoveAllConfirmation + ) { + Button("Remove All Bookmarks") { + settings.bookmarks.removeAll() + } + } } } |