mirror of
https://github.com/yattee/yattee.git
synced 2026-07-19 22:02:10 +00:00
Keep macOS channel search bar pinned right during search
The content type picker in the center .principal toolbar slot is what constrains the .searchable field to the trailing edge. Dropping the picker when a search was submitted let the toolbar reflow and the search field re-center. Keep the picker in place and disable it while searching instead.
This commit is contained in:
@@ -380,10 +380,16 @@ struct ChannelView: View {
|
||||
))
|
||||
.toolbar {
|
||||
#if os(macOS)
|
||||
if supportsChannelTabs && !(isSearchActive && hasSearched) {
|
||||
// Keep the content picker in the center `.principal` slot even while
|
||||
// searching. Its presence is what pins the trailing `.searchable`
|
||||
// field to the right edge — dropping it (or making it zero-width)
|
||||
// lets the search field re-center. During search it's disabled so the
|
||||
// user can't switch tabs while the content area shows search results.
|
||||
if supportsChannelTabs {
|
||||
ToolbarItem(placement: .principal) {
|
||||
contentTypePicker
|
||||
.fixedSize()
|
||||
.disabled(isSearchActive && hasSearched)
|
||||
}
|
||||
}
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user