mirror of
https://github.com/yattee/yattee.git
synced 2026-05-13 02:45:03 +00:00
Use NavigationSplitView on macOS with persistent sidebar Settings button
Replaces the macOS TabView(.sidebarAdaptable) root with NavigationSplitView so the Settings gear can live in the sidebar column's toolbar (next to the sidebar toggle) instead of only appearing in HomeView's detail toolbar.
This commit is contained in:
@@ -10,7 +10,9 @@ import SwiftUI
|
||||
struct HomeView: View {
|
||||
@Environment(\.appEnvironment) private var appEnvironment
|
||||
@Environment(\.scenePhase) private var scenePhase
|
||||
#if !os(tvOS) && !os(macOS)
|
||||
@Namespace private var sheetTransition
|
||||
#endif
|
||||
@State private var playlists: [LocalPlaylist] = []
|
||||
@State private var bookmarksCount: Int = 0
|
||||
@State private var recentBookmarks: [Bookmark] = []
|
||||
@@ -18,7 +20,9 @@ struct HomeView: View {
|
||||
@State private var recentContinueWatching: [WatchEntry] = []
|
||||
@State private var historyCount: Int = 0
|
||||
@State private var recentHistory: [WatchEntry] = []
|
||||
#if !os(tvOS) && !os(macOS)
|
||||
@State private var showingSettings = false
|
||||
#endif
|
||||
@State private var showingOpenLink = false
|
||||
@State private var showingRemoteControl = false
|
||||
@State private var showingCustomizeHome = false
|
||||
@@ -78,7 +82,7 @@ struct HomeView: View {
|
||||
.toolbarTitleDisplayMode(.inlineLarge)
|
||||
#endif
|
||||
.toolbar {
|
||||
#if !os(tvOS)
|
||||
#if !os(tvOS) && !os(macOS)
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
Button {
|
||||
showingSettings = true
|
||||
@@ -91,7 +95,7 @@ struct HomeView: View {
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#if !os(tvOS)
|
||||
#if !os(tvOS) && !os(macOS)
|
||||
.sheet(isPresented: $showingSettings) {
|
||||
SettingsView()
|
||||
.liquidGlassSheetContent(sourceID: "homeSettings", in: sheetTransition)
|
||||
|
||||
Reference in New Issue
Block a user