Back the iPad sidebar switcher with its own pill

This commit is contained in:
Arkadiusz Fal
2026-09-15 23:57:59 +02:00
parent 0aa79221f4
commit a5ed91620f

View File

@@ -73,9 +73,13 @@ struct UnifiedTabView: View {
// is the one surface every tab shares, so the switcher lives here
// rather than on each screen's toolbar.
if DataContextSwitcherVisibility.showsPickers(in: appEnvironment) {
// The bottom bar pins over the list without a background of its
// own, so sidebar rows scrolled to the end show through the
// switcher. A pill of its own keeps what's beneath it blurred.
DataContextSwitcherSettingsRow()
.padding(.horizontal, 8)
.padding(.vertical, 4)
.padding(.horizontal, 14)
.padding(.vertical, 10)
.sidebarBottomBarPill()
}
}
.iOS26TabFeatures(shouldShowAccessory: shouldShowAccessory, settingsManager: appEnvironment?.settingsManager)
@@ -315,6 +319,17 @@ struct UnifiedTabView: View {
private var settingsManager: SettingsManager? { appEnvironment?.settingsManager }
}
private extension View {
@ViewBuilder
func sidebarBottomBarPill() -> some View {
if #available(iOS 26, *) {
glassEffect(.regular, in: .capsule)
} else {
background(.regularMaterial, in: Capsule())
}
}
}
// iOS 26.1+ Tab Features
extension View {
@ViewBuilder