summaryrefslogtreecommitdiff
path: root/Sora/Views/Generic
diff options
context:
space:
mode:
Diffstat (limited to 'Sora/Views/Generic')
-rw-r--r--Sora/Views/Generic/GenericListView.swift15
1 files changed, 15 insertions, 0 deletions
diff --git a/Sora/Views/Generic/GenericListView.swift b/Sora/Views/Generic/GenericListView.swift
index 3e5154f..d1c1436 100644
--- a/Sora/Views/Generic/GenericListView.swift
+++ b/Sora/Views/Generic/GenericListView.swift
@@ -18,8 +18,10 @@ struct GenericListView<T: Identifiable & Hashable & GenericItem>: View {
@State private var sort: SettingsBookmarkSort = .dateAdded
@State private var isCollectionPickerPresented = false
@State private var isProviderPickerPresented = false
+ @State private var isSettingsPresented = false
@State private var selectedProvider: BooruProvider?
let allowBookmarking: Bool
+ let showsSettingsButton: Bool
let title: String
let emptyMessage: String
let emptyIcon: String
@@ -292,6 +294,14 @@ struct GenericListView<T: Identifiable & Hashable & GenericItem>: View {
#endif
#if os(iOS)
+ if showsSettingsButton {
+ ToolbarItem(placement: .topBarTrailing) {
+ Button(action: { isSettingsPresented = true }) {
+ Label("Settings", systemImage: "gear")
+ }
+ }
+ }
+
ToolbarItemGroup(placement: .secondaryAction) {
if !allowBookmarking {
Menu {
@@ -389,6 +399,11 @@ struct GenericListView<T: Identifiable & Hashable & GenericItem>: View {
}
#endif
}
+ #if !os(macOS)
+ .sheet(isPresented: $isSettingsPresented) {
+ SettingsView()
+ }
+ #endif
.onAppear {
refreshFolderHierarchy()
refreshDisplayedItems()