Commit b35b748620

b35b7486209491fd0b6833f1939c0483ae6f6007

parent: 035009dce5

Verified · cmc

cmc <hello@cleberg.net> · 2026-11-22 03:34 UTC

Give the sidebar's bar a solid background

The rows scrolling under it showed through its buttons.

Ref #92

Layout: unified · split

Sources/Orgstar/Sidebar.swift +9
@@ -142,6 +142,7 @@ struct SidebarBar<Content: View>: View {
142 @Binding var showsAgenda: Bool 142 @Binding var showsAgenda: Bool
143 @ViewBuilder var content: Content 143 @ViewBuilder var content: Content
144 @Environment(\.orgTheme) private var theme 144 @Environment(\.orgTheme) private var theme
145 @Environment(\.colorScheme) private var colorScheme
145 146
146 var body: some View { 147 var body: some View {
147 HStack(spacing: 6) { 148 HStack(spacing: 6) {
@@ -157,6 +158,14 @@ struct SidebarBar<Content: View>: View {
157 .foregroundStyle(theme.color("sidebar-foreground") ?? .primary) 158 .foregroundStyle(theme.color("sidebar-foreground") ?? .primary)
158 .padding(.horizontal, 10) 159 .padding(.horizontal, 10)
159 .padding(.vertical, 7) 160 .padding(.vertical, 7)
161 // Solid, so the rows scrolling under the bar don't show through its buttons.
162 .background {
163 if let color = theme.color("sidebar-background", in: colorScheme) {
164 color
165 } else {
166 Rectangle().fill(.ultraThickMaterial)
167 }
168 }
160 .overlay(alignment: .top) { Divider() } 169 .overlay(alignment: .top) { Divider() }
161 } 170 }
162} 171}