mirror of
https://github.com/yattee/yattee.git
synced 2026-10-24 05:32:53 +00:00
Leave the macOS toolbars to the sidebar's account switcher
This commit is contained in:
@@ -331,11 +331,15 @@ struct HistoryListView: View {
|
||||
ToolbarSpacer(.flexible, placement: .primaryAction)
|
||||
}
|
||||
#endif
|
||||
// No switcher on macOS: the sidebar row is the one persistent
|
||||
// switcher surface there.
|
||||
#if !os(macOS)
|
||||
if DataContextSwitcherVisibility.showsPickers(in: appEnvironment) {
|
||||
ToolbarItem(placement: viewOptionsPlacement) {
|
||||
DataContextSwitcherMenu()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
// View options button (always visible)
|
||||
ToolbarItem(placement: viewOptionsPlacement) {
|
||||
Button {
|
||||
|
||||
@@ -147,17 +147,6 @@ struct HomeView: View {
|
||||
appEnvironment?.settingsManager.listStyle ?? .inset
|
||||
}
|
||||
|
||||
#if !os(tvOS)
|
||||
/// Same edge the switcher sits on in Subscriptions/History/Playlists:
|
||||
/// leading on macOS, trailing elsewhere.
|
||||
private var switcherPlacement: ToolbarItemPlacement {
|
||||
#if os(macOS)
|
||||
.navigation
|
||||
#else
|
||||
.primaryAction
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
|
||||
var body: some View {
|
||||
// Split from `chrome` so the modifier chain stays within what the
|
||||
@@ -177,9 +166,11 @@ struct HomeView: View {
|
||||
.toolbarTitleDisplayMode(.inlineLarge)
|
||||
#endif
|
||||
.toolbar {
|
||||
#if !os(tvOS)
|
||||
// No switcher on macOS: the sidebar row is the one persistent
|
||||
// switcher surface there.
|
||||
#if !os(tvOS) && !os(macOS)
|
||||
if DataContextSwitcherVisibility.showsPickers(in: appEnvironment) {
|
||||
ToolbarItem(placement: switcherPlacement) {
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
DataContextSwitcherMenu()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -229,11 +229,15 @@ struct PlaylistsListView: View {
|
||||
ToolbarSpacer(.flexible, placement: .primaryAction)
|
||||
}
|
||||
#endif
|
||||
// No switcher on macOS: the sidebar row is the one persistent
|
||||
// switcher surface there.
|
||||
#if !os(macOS)
|
||||
if DataContextSwitcherVisibility.showsPickers(in: appEnvironment) {
|
||||
ToolbarItem(placement: viewOptionsPlacement) {
|
||||
DataContextSwitcherMenu()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
ToolbarItem(placement: viewOptionsPlacement) {
|
||||
Button {
|
||||
showViewOptions = true
|
||||
|
||||
@@ -492,11 +492,15 @@ struct SubscriptionsView: View {
|
||||
.toolbarTitleDisplayMode(.inlineLarge)
|
||||
#endif
|
||||
.toolbar {
|
||||
// No switcher on macOS: the sidebar row is the one persistent
|
||||
// switcher surface there.
|
||||
#if !os(macOS)
|
||||
if DataContextSwitcherVisibility.showsPickers(in: appEnvironment) {
|
||||
ToolbarItem(placement: viewOptionsPlacement) {
|
||||
DataContextSwitcherMenu()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
ToolbarItem(placement: viewOptionsPlacement) {
|
||||
Button {
|
||||
showViewOptions = true
|
||||
|
||||
Reference in New Issue
Block a user