mirror of
https://github.com/yattee/yattee.git
synced 2026-07-21 14:52:03 +00:00
Present view options and search filters as popovers on macOS
Plain-Form sheets rendered as columns-style content floating inside oversized fixed frames on macOS. Anchor these panels to their toolbar buttons as popovers instead, sized to content; iOS/tvOS keep sheets. - Search and PeerTube explore filters apply live (Cancel never reverted anything anyway) and dismiss on outside click - Subscriptions/Manage Channels "Subscriptions Data" opens as a sheet from the popover's onDisappear via a pending flag, since presenting while the popover dismisses gets swallowed - Media browser view options drop navigation chrome on macOS
This commit is contained in:
@@ -93,17 +93,23 @@ struct PeerTubeInstancesExploreView: View {
|
||||
.task {
|
||||
await loadAllInstances()
|
||||
}
|
||||
#if !os(macOS)
|
||||
.sheet(isPresented: $showFiltersSheet) {
|
||||
PeerTubeFiltersSheet(
|
||||
filters: $filters,
|
||||
languages: availableLanguages,
|
||||
countries: availableCountries,
|
||||
onApply: {
|
||||
// Reset display limit when filters change
|
||||
displayLimit = pageSize
|
||||
}
|
||||
)
|
||||
filtersSheetContent
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
private var filtersSheetContent: some View {
|
||||
PeerTubeFiltersSheet(
|
||||
filters: $filters,
|
||||
languages: availableLanguages,
|
||||
countries: availableCountries,
|
||||
onApply: {
|
||||
// Reset display limit when filters change
|
||||
displayLimit = pageSize
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
// MARK: - Content
|
||||
@@ -227,6 +233,11 @@ struct PeerTubeInstancesExploreView: View {
|
||||
systemImage: filters.isDefault ? "line.3.horizontal.decrease.circle" : "line.3.horizontal.decrease.circle.fill"
|
||||
)
|
||||
}
|
||||
#if os(macOS)
|
||||
.popover(isPresented: $showFiltersSheet, arrowEdge: .bottom) {
|
||||
filtersSheetContent
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user