@@ -239,12 +239,18 @@ open class ViewControllerComponentContainer: ViewController {
239239 }
240240 }
241241
242+ public enum BaseNavigationColors {
243+ case plain
244+ case blocks
245+ }
246+
242247 public var node : Node {
243248 return self . displayNode as! Node
244249 }
245250
246251 private var presentationData : PresentationData
247252 private var theme : Theme
253+ private let baseNavigationColors : BaseNavigationColors
248254 public private( set) var component : AnyComponent < ViewControllerComponentContainer . Environment >
249255
250256 private var presentationDataDisposable : Disposable ?
@@ -260,10 +266,12 @@ open class ViewControllerComponentContainer: ViewController {
260266 statusBarStyle: StatusBarStyle = . default,
261267 presentationMode: PresentationMode = . default,
262268 theme: Theme = . default,
263- updatedPresentationData: ( initial: PresentationData , signal: Signal < PresentationData , NoError > ) ? = nil
269+ updatedPresentationData: ( initial: PresentationData , signal: Signal < PresentationData , NoError > ) ? = nil ,
270+ baseNavigationColors: BaseNavigationColors = . plain,
264271 ) where C. EnvironmentType == ViewControllerComponentContainer . Environment {
265272 self . component = AnyComponent ( component)
266273 self . theme = theme
274+ self . baseNavigationColors = baseNavigationColors
267275
268276 var effectiveUpdatedPresentationData : ( initial: PresentationData , signal: Signal < PresentationData , NoError > )
269277 if let updatedPresentationData {
@@ -282,7 +290,7 @@ open class ViewControllerComponentContainer: ViewController {
282290 case . transparent:
283291 navigationBarPresentationData = NavigationBarPresentationData ( presentationData: presentationData, hideBackground: true , hideBadge: false , hideSeparator: true , style: . glass)
284292 case . default:
285- navigationBarPresentationData = NavigationBarPresentationData ( presentationData: presentationData, style: . glass)
293+ navigationBarPresentationData = NavigationBarPresentationData ( presentationData: presentationData, hideBackground : false , hideBadge : false , hideSeparator : true , style: . glass, edgeEffectColor : self . baseNavigationColors == . blocks ? self . presentationData . theme . list . itemBlocksBackgroundColor : nil )
286294 }
287295 super. init ( navigationBarPresentationData: navigationBarPresentationData)
288296
@@ -297,10 +305,12 @@ open class ViewControllerComponentContainer: ViewController {
297305 statusBarStyle: StatusBarStyle = . default,
298306 presentationMode: PresentationMode = . default,
299307 theme: Theme = . default,
300- updatedPresentationData: ( initial: PresentationData , signal: Signal < PresentationData , NoError > )
308+ updatedPresentationData: ( initial: PresentationData , signal: Signal < PresentationData , NoError > ) ,
309+ baseNavigationColors: BaseNavigationColors = . plain
301310 ) where C. EnvironmentType == ViewControllerComponentContainer . Environment {
302311 self . component = AnyComponent ( component)
303312 self . theme = theme
313+ self . baseNavigationColors = baseNavigationColors
304314
305315 let presentationData = updatedPresentationData. initial
306316 self . presentationData = presentationData
@@ -312,7 +322,7 @@ open class ViewControllerComponentContainer: ViewController {
312322 case . transparent:
313323 navigationBarPresentationData = NavigationBarPresentationData ( presentationData: presentationData, hideBackground: true , hideBadge: false , hideSeparator: true , style: . glass)
314324 case . default:
315- navigationBarPresentationData = NavigationBarPresentationData ( presentationData: presentationData, style: . glass)
325+ navigationBarPresentationData = NavigationBarPresentationData ( presentationData: presentationData, hideBackground : false , hideBadge : false , hideSeparator : true , style: . glass, edgeEffectColor : self . baseNavigationColors == . blocks ? self . presentationData . theme . list . itemBlocksBackgroundColor : nil )
316326 }
317327 super. init ( navigationBarPresentationData: navigationBarPresentationData)
318328
@@ -360,7 +370,7 @@ open class ViewControllerComponentContainer: ViewController {
360370 case . transparent:
361371 navigationBarPresentationData = NavigationBarPresentationData ( presentationData: presentationData, hideBackground: true , hideBadge: false , hideSeparator: true , style: . glass)
362372 case . default:
363- navigationBarPresentationData = NavigationBarPresentationData ( presentationData: presentationData, style: . glass)
373+ navigationBarPresentationData = NavigationBarPresentationData ( presentationData: presentationData, hideBackground : false , hideBadge : false , hideSeparator : true , style: . glass, edgeEffectColor : strongSelf . baseNavigationColors == . blocks ? strongSelf . presentationData . theme . list . itemBlocksBackgroundColor : nil )
364374 }
365375 if let navigationBarPresentationData {
366376 strongSelf. navigationBar? . updatePresentationData ( navigationBarPresentationData, transition: . immediate)
0 commit comments