From a2ef2a7376bb2205e2fc899297a5e8643b8be7c1 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Sat, 14 Jun 2025 09:41:58 -0700 Subject: feat: Development commit --- Sora/Views/Generic/GenericListView.swift | 70 ++++++++++++++++++++------------ 1 file changed, 44 insertions(+), 26 deletions(-) (limited to 'Sora/Views') diff --git a/Sora/Views/Generic/GenericListView.swift b/Sora/Views/Generic/GenericListView.swift index 0193471..b9b327c 100644 --- a/Sora/Views/Generic/GenericListView.swift +++ b/Sora/Views/Generic/GenericListView.swift @@ -80,40 +80,32 @@ struct GenericListView: View { // swi description: Text(emptyDescription) ) } else { - if !settings.folders.isEmpty && !allowBookmarking { - Picker("Sort", selection: $sort) { - ForEach(SettingsBookmarkSort.allCases, id: \.rawValue) { sortMode in - Text(sortMode.rawValue).tag(sortMode) + #if os(macOS) + if !settings.folders.isEmpty && !allowBookmarking { + Picker("Sort", selection: $sort) { + ForEach(SettingsBookmarkSort.allCases, id: \.rawValue) { sortMode in + Text(sortMode.rawValue).tag(sortMode) + } } - } - #if os(macOS) .padding() .pickerStyle(.menu) - #else - .padding(.horizontal) - .pickerStyle(.palette) - .padding(.bottom) - #endif - Picker("Collection", selection: $selectedFolder) { - Text("All").tag(nil as UUID?) + 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) + } } - } - .padding(.bottom) - .padding(.horizontal) - #if os(macOS) + .padding(.bottom) + .padding(.horizontal) .pickerStyle(.menu) - #else - .pickerStyle(NavigationLinkPickerStyle()) - #endif - } + } + #endif List { if filteredItems.isEmpty && (!searchText.isEmpty || !(selectedFolder == nil)) { @@ -149,6 +141,32 @@ struct GenericListView: View { // swi Label("Remove All", systemImage: "trash") } } + + #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) + } + } + .pickerStyle(.menu) + + Picker("Collection", selection: $selectedFolder) { + Text("All").tag(nil 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) + } + } + .pickerStyle(.menu) + } + } + #endif } .confirmationDialog( removeAllMessage, -- cgit v1.2.3