summaryrefslogtreecommitdiff
path: root/Sora
diff options
context:
space:
mode:
authorFuwn <[email protected]>2025-06-14 09:50:44 -0700
committerFuwn <[email protected]>2025-06-14 09:50:44 -0700
commit4027b907a5f4279c32a9dd30a12a5ef1cf54b7ee (patch)
treed5601fdac4461cea386bf8157c5e314a12a701fc /Sora
parentfeat: Development commit (diff)
downloadsora-testing-4027b907a5f4279c32a9dd30a12a5ef1cf54b7ee.tar.xz
sora-testing-4027b907a5f4279c32a9dd30a12a5ef1cf54b7ee.zip
feat: Development commit
Diffstat (limited to 'Sora')
-rw-r--r--Sora/Views/Generic/GenericListView.swift42
1 files changed, 30 insertions, 12 deletions
diff --git a/Sora/Views/Generic/GenericListView.swift b/Sora/Views/Generic/GenericListView.swift
index b9b327c..8fd768b 100644
--- a/Sora/Views/Generic/GenericListView.swift
+++ b/Sora/Views/Generic/GenericListView.swift
@@ -13,6 +13,8 @@ struct GenericListView<T: Identifiable & Hashable & GenericItem>: View { // swi
@State private var isCollectionErrorAlertPresented = false
@State private var selectedFolder: UUID?
@State private var sort: SettingsBookmarkSort = .dateBookmarked
+ @State private var isSortPickerPresented = false
+ @State private var isCollectionPickerPresented = false
let allowBookmarking: Bool
let title: String
let emptyMessage: String
@@ -145,25 +147,41 @@ struct GenericListView<T: Identifiable & Hashable & GenericItem>: View { // swi
#if os(iOS)
ToolbarItemGroup(placement: .bottomBar) {
if !settings.folders.isEmpty && !allowBookmarking {
- Picker("Sort", selection: $sort) {
- ForEach(SettingsBookmarkSort.allCases, id: \.rawValue) { sortMode in
- Text(sortMode.rawValue).tag(sortMode)
+ Button {
+ isSortPickerPresented.toggle()
+ } label: {
+ Label("Sort", systemImage: "arrow.up.arrow.down")
+ }
+ .popover(isPresented: $isSortPickerPresented) {
+ Picker("Sort", selection: $sort) {
+ ForEach(SettingsBookmarkSort.allCases, id: \.rawValue) { sortMode in
+ Text(sortMode.rawValue).tag(sortMode)
+ }
}
+ .pickerStyle(.inline)
+ .padding()
}
- .pickerStyle(.menu)
- Picker("Collection", selection: $selectedFolder) {
- Text("All").tag(nil as UUID?)
+ Button {
+ isCollectionPickerPresented.toggle()
+ } label: {
+ Label("Collection", systemImage: "folder")
+ }
+ .popover(isPresented: $isCollectionPickerPresented) {
+ Picker("Collection", selection: $selectedFolder) {
+ Text("All").tag(nil as UUID?)
- if items.contains(where: { $0.folder == nil }) {
- Text("Uncategorised").tag(uncategorisedUUID as UUID?)
- }
+ if items.contains(where: { $0.folder == nil }) {
+ Text("Uncategorised").tag(uncategorisedUUID as UUID?)
+ }
- ForEach(settings.folders, id: \.id) { folder in
- Text(folder.name).tag(folder.id)
+ ForEach(settings.folders, id: \.id) { folder in
+ Text(folder.name).tag(folder.id)
+ }
}
+ .pickerStyle(.inline)
+ .padding()
}
- .pickerStyle(.menu)
}
}
#endif