mirror of
https://github.com/yattee/yattee.git
synced 2026-07-19 22:02:10 +00:00
Pin search bar to right of macOS toolbar in list views
Match the global Search view by pinning the searchable field and trailing buttons to the right edge on macOS 26 via a flexible ToolbarSpacer at .primaryAction. Applied to History, Bookmarks, Manage Channels, Downloads, Instance Browse, and PeerTube Explore. In History, the clear-history item moves from .automatic to .primaryAction so it groups with the other trailing controls.
This commit is contained in:
@@ -38,6 +38,13 @@ struct DownloadsView: View {
|
||||
.navigationTitle(String(localized: "downloads.title"))
|
||||
.toolbarTitleDisplayMode(.inlineLarge)
|
||||
.toolbar {
|
||||
#if os(macOS)
|
||||
// Pin the trailing group (search field + toolbar buttons) to the right edge,
|
||||
// matching the global Search view.
|
||||
if #available(macOS 26, *) {
|
||||
ToolbarSpacer(.flexible, placement: .primaryAction)
|
||||
}
|
||||
#endif
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
if let settings = downloadSettings {
|
||||
sortAndGroupMenu(settings)
|
||||
|
||||
@@ -153,6 +153,13 @@ struct BookmarksListView: View {
|
||||
.toolbarTitleDisplayMode(.inlineLarge)
|
||||
.searchable(text: $searchText, prompt: Text(String(localized: "bookmarks.search.placeholder")))
|
||||
.toolbar {
|
||||
#if os(macOS)
|
||||
// Pin the trailing group (search field + toolbar buttons) to the right edge,
|
||||
// matching the global Search view.
|
||||
if #available(macOS 26, *) {
|
||||
ToolbarSpacer(.flexible, placement: .primaryAction)
|
||||
}
|
||||
#endif
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
Button {
|
||||
showViewOptions = true
|
||||
|
||||
@@ -167,6 +167,13 @@ struct HistoryListView: View {
|
||||
.toolbarTitleDisplayMode(.inlineLarge)
|
||||
.searchable(text: $searchText, prompt: Text(String(localized: "history.search.placeholder")))
|
||||
.toolbar {
|
||||
#if os(macOS)
|
||||
// Pin the trailing group (search field + toolbar buttons) to the right edge,
|
||||
// matching the global Search view.
|
||||
if #available(macOS 26, *) {
|
||||
ToolbarSpacer(.flexible, placement: .primaryAction)
|
||||
}
|
||||
#endif
|
||||
// View options button (always visible)
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
Button {
|
||||
@@ -184,7 +191,7 @@ struct HistoryListView: View {
|
||||
|
||||
// Clear history menu (only when not empty)
|
||||
if !history.isEmpty {
|
||||
ToolbarItem(placement: .automatic) {
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
Menu {
|
||||
ForEach(ClearHistoryOption.allCases, id: \.self) { option in
|
||||
Button(role: .destructive) {
|
||||
|
||||
@@ -340,6 +340,13 @@ struct InstanceBrowseView: View {
|
||||
.navigationTitle(instance.displayName)
|
||||
.toolbarTitleDisplayMode(.inlineLarge)
|
||||
.toolbar {
|
||||
#if os(macOS)
|
||||
// Pin the trailing group (search field + toolbar buttons) to the right edge,
|
||||
// matching the global Search view.
|
||||
if #available(macOS 26, *) {
|
||||
ToolbarSpacer(.flexible, placement: .primaryAction)
|
||||
}
|
||||
#endif
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
Button {
|
||||
showViewOptions = true
|
||||
|
||||
@@ -224,6 +224,13 @@ struct PeerTubeInstancesExploreView: View {
|
||||
sheetCloseToolbarItem { dismiss() }
|
||||
#endif
|
||||
|
||||
#if os(macOS)
|
||||
// Pin the trailing group (search field + toolbar buttons) to the right edge,
|
||||
// matching the global Search view.
|
||||
if #available(macOS 26, *) {
|
||||
ToolbarSpacer(.flexible, placement: .primaryAction)
|
||||
}
|
||||
#endif
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
Button {
|
||||
showFiltersSheet = true
|
||||
|
||||
@@ -191,6 +191,13 @@ struct ManageChannelsView: View {
|
||||
.toolbarTitleDisplayMode(.inlineLarge)
|
||||
.searchable(text: $searchText, prompt: Text(String(localized: "channels.search.placeholder")))
|
||||
.toolbar {
|
||||
#if os(macOS)
|
||||
// Pin the trailing group (search field + toolbar buttons) to the right edge,
|
||||
// matching the global Search view.
|
||||
if #available(macOS 26, *) {
|
||||
ToolbarSpacer(.flexible, placement: .primaryAction)
|
||||
}
|
||||
#endif
|
||||
ToolbarItem(placement: .primaryAction) {
|
||||
Button {
|
||||
showViewOptions = true
|
||||
|
||||
Reference in New Issue
Block a user