mirror of
https://github.com/yattee/yattee.git
synced 2026-05-12 18:35:05 +00:00
Replace search content type segmented picker with Menu on tvOS
Unifies the filter strip on tvOS so all filters (sort, date, duration, content type) use the same inline Menu style instead of mixing menus with a segmented picker.
This commit is contained in:
@@ -553,7 +553,18 @@ struct InstanceBrowseView: View {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Content type segmented picker
|
// Content type picker
|
||||||
|
#if os(tvOS)
|
||||||
|
filterMenu(
|
||||||
|
title: String(localized: "search.filters.type"),
|
||||||
|
selection: Binding(
|
||||||
|
get: { searchViewModel?.filters.type ?? .video },
|
||||||
|
set: { searchViewModel?.filters.type = $0 }
|
||||||
|
),
|
||||||
|
options: SearchContentType.allCases,
|
||||||
|
labelForOption: { $0.title }
|
||||||
|
)
|
||||||
|
#else
|
||||||
Picker("", selection: Binding(
|
Picker("", selection: Binding(
|
||||||
get: { searchViewModel?.filters.type ?? .video },
|
get: { searchViewModel?.filters.type ?? .video },
|
||||||
set: { searchViewModel?.filters.type = $0 }
|
set: { searchViewModel?.filters.type = $0 }
|
||||||
@@ -563,6 +574,7 @@ struct InstanceBrowseView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.pickerStyle(.segmented)
|
.pickerStyle(.segmented)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
.padding(.vertical, 8)
|
.padding(.vertical, 8)
|
||||||
|
|||||||
@@ -425,7 +425,18 @@ struct SearchView: View {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Content type segmented picker
|
// Content type picker
|
||||||
|
#if os(tvOS)
|
||||||
|
filterMenu(
|
||||||
|
title: String(localized: "search.filters.type"),
|
||||||
|
selection: Binding(
|
||||||
|
get: { searchViewModel?.filters.type ?? .video },
|
||||||
|
set: { searchViewModel?.filters.type = $0 }
|
||||||
|
),
|
||||||
|
options: SearchContentType.allCases,
|
||||||
|
labelForOption: { $0.title }
|
||||||
|
)
|
||||||
|
#else
|
||||||
Picker("", selection: Binding(
|
Picker("", selection: Binding(
|
||||||
get: { searchViewModel?.filters.type ?? .video },
|
get: { searchViewModel?.filters.type ?? .video },
|
||||||
set: { searchViewModel?.filters.type = $0 }
|
set: { searchViewModel?.filters.type = $0 }
|
||||||
@@ -435,6 +446,7 @@ struct SearchView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.pickerStyle(.segmented)
|
.pickerStyle(.segmented)
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
.padding(.horizontal)
|
.padding(.horizontal)
|
||||||
.padding(.vertical, 8)
|
.padding(.vertical, 8)
|
||||||
|
|||||||
Reference in New Issue
Block a user