Skip to content

Commit

Permalink
Fix brave/brave-ios#7615: Don't leak status bar color while in overla…
Browse files Browse the repository at this point in the history
  • Loading branch information
iccub authored Jun 26, 2023
1 parent c99c8f6 commit eae08c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Sources/Brave/Frontend/Browser/BrowserViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public class BrowserViewController: UIViewController {
var readerModeBar: ReaderModeBarView?
var readerModeCache: ReaderModeCache

private let statusBarOverlay: UIView = {
let statusBarOverlay: UIView = {
// Temporary work around for covering the non-clipped web view content
let statusBarOverlay = UIView()
statusBarOverlay.backgroundColor = Preferences.General.nightModeEnabled.value ? .nightModeBackground : .urlBarBackground
Expand Down Expand Up @@ -784,8 +784,8 @@ public class BrowserViewController: UIViewController {
view.addSubview(topTouchArea)
view.addSubview(bottomBarKeyboardBackground)
view.addSubview(footer)
view.addSubview(header)
view.addSubview(statusBarOverlay)
view.addSubview(header)

// For now we hide some elements so they are not visible
header.isHidden = true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,11 @@ extension BrowserViewController: TopToolbarDelegate {
if let ntpController = self.activeNewTabPageViewController, ntpController.parent != nil {
view.insertSubview(favoritesController.view, aboveSubview: ntpController.view)
} else {
view.insertSubview(favoritesController.view, aboveSubview: footer)
// Two different behaviors here:
// 1. For bottom bar we do not want to show the status bar color
// 2. For top bar we do so it matches the address bar background
let subview = isUsingBottomBar ? statusBarOverlay : footer
view.insertSubview(favoritesController.view, aboveSubview: subview)
}
favoritesController.didMove(toParent: self)

Expand Down

0 comments on commit eae08c6

Please sign in to comment.