mirror of
https://github.com/yattee/yattee.git
synced 2026-07-21 06:42:01 +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:
@@ -82,6 +82,16 @@ struct BookmarksListView: View {
|
||||
return ([], nil)
|
||||
}
|
||||
|
||||
private var viewOptionsSheetContent: some View {
|
||||
ViewOptionsSheet(
|
||||
layout: $layout,
|
||||
rowStyle: $rowStyle,
|
||||
gridColumns: $gridColumns,
|
||||
hideWatched: $hideWatched,
|
||||
maxGridColumns: gridConfig.maxColumns
|
||||
)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { geometry in
|
||||
#if os(tvOS)
|
||||
@@ -150,19 +160,20 @@ struct BookmarksListView: View {
|
||||
Label(String(localized: "viewOptions.title"), systemImage: "slider.horizontal.3")
|
||||
}
|
||||
.liquidGlassTransitionSource(id: "bookmarksViewOptions", in: sheetTransition)
|
||||
#if os(macOS)
|
||||
.popover(isPresented: $showViewOptions, arrowEdge: .bottom) {
|
||||
viewOptionsSheetContent
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if !os(macOS)
|
||||
.sheet(isPresented: $showViewOptions) {
|
||||
ViewOptionsSheet(
|
||||
layout: $layout,
|
||||
rowStyle: $rowStyle,
|
||||
gridColumns: $gridColumns,
|
||||
hideWatched: $hideWatched,
|
||||
maxGridColumns: gridConfig.maxColumns
|
||||
)
|
||||
.liquidGlassSheetContent(sourceID: "bookmarksViewOptions", in: sheetTransition)
|
||||
viewOptionsSheetContent
|
||||
.liquidGlassSheetContent(sourceID: "bookmarksViewOptions", in: sheetTransition)
|
||||
}
|
||||
#endif
|
||||
.onAppear {
|
||||
loadBookmarks()
|
||||
loadWatchEntries()
|
||||
|
||||
@@ -41,6 +41,15 @@ struct ContinueWatchingView: View {
|
||||
GridLayoutConfiguration(viewWidth: viewWidth, gridColumns: gridColumns)
|
||||
}
|
||||
|
||||
private var viewOptionsSheetContent: some View {
|
||||
ViewOptionsSheet(
|
||||
layout: $layout,
|
||||
rowStyle: $rowStyle,
|
||||
gridColumns: $gridColumns,
|
||||
maxGridColumns: gridConfig.maxColumns
|
||||
)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { geometry in
|
||||
#if os(tvOS)
|
||||
@@ -122,6 +131,11 @@ struct ContinueWatchingView: View {
|
||||
Label(String(localized: "viewOptions.title"), systemImage: "slider.horizontal.3")
|
||||
}
|
||||
.liquidGlassTransitionSource(id: "continueWatchingViewOptions", in: sheetTransition)
|
||||
#if os(macOS)
|
||||
.popover(isPresented: $showViewOptions, arrowEdge: .bottom) {
|
||||
viewOptionsSheetContent
|
||||
}
|
||||
#endif
|
||||
}
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
Menu {
|
||||
@@ -137,15 +151,12 @@ struct ContinueWatchingView: View {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if !os(macOS)
|
||||
.sheet(isPresented: $showViewOptions) {
|
||||
ViewOptionsSheet(
|
||||
layout: $layout,
|
||||
rowStyle: $rowStyle,
|
||||
gridColumns: $gridColumns,
|
||||
maxGridColumns: gridConfig.maxColumns
|
||||
)
|
||||
.liquidGlassSheetContent(sourceID: "continueWatchingViewOptions", in: sheetTransition)
|
||||
viewOptionsSheetContent
|
||||
.liquidGlassSheetContent(sourceID: "continueWatchingViewOptions", in: sheetTransition)
|
||||
}
|
||||
#endif
|
||||
.onAppear {
|
||||
loadHistory()
|
||||
}
|
||||
|
||||
@@ -79,6 +79,16 @@ struct HistoryListView: View {
|
||||
return ([], nil)
|
||||
}
|
||||
|
||||
private var viewOptionsSheetContent: some View {
|
||||
ViewOptionsSheet(
|
||||
layout: $layout,
|
||||
rowStyle: $rowStyle,
|
||||
gridColumns: $gridColumns,
|
||||
hideWatched: nil, // No hide watched for history view
|
||||
maxGridColumns: gridConfig.maxColumns
|
||||
)
|
||||
}
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { geometry in
|
||||
#if os(tvOS)
|
||||
@@ -165,6 +175,11 @@ struct HistoryListView: View {
|
||||
Label(String(localized: "viewOptions.title"), systemImage: "slider.horizontal.3")
|
||||
}
|
||||
.liquidGlassTransitionSource(id: "historyViewOptions", in: sheetTransition)
|
||||
#if os(macOS)
|
||||
.popover(isPresented: $showViewOptions, arrowEdge: .bottom) {
|
||||
viewOptionsSheetContent
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Clear history menu (only when not empty)
|
||||
@@ -186,16 +201,12 @@ struct HistoryListView: View {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#if !os(macOS)
|
||||
.sheet(isPresented: $showViewOptions) {
|
||||
ViewOptionsSheet(
|
||||
layout: $layout,
|
||||
rowStyle: $rowStyle,
|
||||
gridColumns: $gridColumns,
|
||||
hideWatched: nil, // No hide watched for history view
|
||||
maxGridColumns: gridConfig.maxColumns
|
||||
)
|
||||
.liquidGlassSheetContent(sourceID: "historyViewOptions", in: sheetTransition)
|
||||
viewOptionsSheetContent
|
||||
.liquidGlassSheetContent(sourceID: "historyViewOptions", in: sheetTransition)
|
||||
}
|
||||
#endif
|
||||
.confirmationDialog(
|
||||
confirmationTitle,
|
||||
isPresented: $showingClearConfirmation,
|
||||
|
||||
Reference in New Issue
Block a user