diff options
| author | Fuwn <[email protected]> | 2025-06-15 01:19:33 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2025-06-15 01:19:33 -0700 |
| commit | 11e6e0ec638bfe18c7c973dcdd44b4eefe8b0d79 (patch) | |
| tree | 53b7944e8c2b78a891e8815536c149c667d4334f | |
| parent | feat: Development commit (diff) | |
| download | sora-testing-11e6e0ec638bfe18c7c973dcdd44b4eefe8b0d79.tar.xz sora-testing-11e6e0ec638bfe18c7c973dcdd44b4eefe8b0d79.zip | |
feat: Development commit
| -rw-r--r-- | Sora/Views/PlatformSpecificToolbarItem.swift | 8 | ||||
| -rw-r--r-- | Sora/Views/Post/Grid/PostGridView.swift | 14 |
2 files changed, 16 insertions, 6 deletions
diff --git a/Sora/Views/PlatformSpecificToolbarItem.swift b/Sora/Views/PlatformSpecificToolbarItem.swift index 4a44db0..578affe 100644 --- a/Sora/Views/PlatformSpecificToolbarItem.swift +++ b/Sora/Views/PlatformSpecificToolbarItem.swift @@ -5,13 +5,17 @@ struct PlatformSpecificToolbarItem<Content: View>: ToolbarContent { let content: () -> Content init( - placement: ToolbarItemPlacement?, + placement: ToolbarItemPlacement? = nil, @ViewBuilder content: @escaping () -> Content ) { #if os(macOS) self.placement = .automatic #else - self.placement = placement ?? .bottomBar + if #available(iOS 26, *) { + self.placement = placement ?? .secondaryAction + } else { + self.placement = placement ?? .bottomBar + } #endif self.content = content diff --git a/Sora/Views/Post/Grid/PostGridView.swift b/Sora/Views/Post/Grid/PostGridView.swift index 39cd7da..6d40c7e 100644 --- a/Sora/Views/Post/Grid/PostGridView.swift +++ b/Sora/Views/Post/Grid/PostGridView.swift @@ -127,23 +127,23 @@ struct PostGridView: View { #endif #if !os(macOS) - ToolbarItem(placement: .secondaryAction) { + PlatformSpecificToolbarItem { Button(action: { Task { isSearchHistoryPresented.toggle() } }) { Label("Search History", systemImage: "clock.arrow.circlepath") } } - if manager.isLoading || manager.isNavigatingHistory { + if #available(iOS 26, *), manager.isLoading || manager.isNavigatingHistory { ToolbarItem(placement: .status) { ProgressView() } } #endif - PlatformSpecificToolbarItem(placement: .secondaryAction) { + PlatformSpecificToolbarItem { PostGridBookmarkButtonView() .disabled(manager.tags.isEmpty) } - PlatformSpecificToolbarItem(placement: .secondaryAction) { + PlatformSpecificToolbarItem { Button(action: { Task { manager.loadNextPage() } }) { Label( "Manually Load Next Page", @@ -153,6 +153,12 @@ struct PostGridView: View { .disabled(manager.isLoading || manager.endOfData) } + #if !os(macOS) + if #unavailable(iOS 26), manager.isLoading || manager.isNavigatingHistory { + ToolbarItem(placement: .topBarTrailing) { ProgressView() } + } + #endif + PlatformSpecificToolbarItem(placement: .navigation) { Button(action: { manager.goBackInHistory() }) { Label("Previous Search", systemImage: "chevron.left") |