Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Ref #1493: Coloring fixes (#1502)
Browse files Browse the repository at this point in the history
* Adjusted background color for back/forward menu.
* Updated the first onboarding screen per design QA.
  • Loading branch information
jhreis authored and iccub committed Sep 6, 2019
1 parent 45787a9 commit 5124fa8
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 4 deletions.
10 changes: 10 additions & 0 deletions Client/Extensions/AppearanceExtensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// file, You can obtain one at http://mozilla.org/MPL/2.0/.

import Foundation
import BraveShared

extension Theme {
func applyAppearanceProperties() {
Expand Down Expand Up @@ -64,6 +65,15 @@ extension Theme {
} else {
// iOS 12 fixes, many styling items do not work properly in iOS 12
UILabel.appearance().appearanceTextColor = colors.tints.home

// iOS 12 does not allow in-line color overrides :/
// These UI components are currently non-themed
// AlertPopupView
UILabel.appearance(whenContainedInInstancesOf: [AlertPopupView.self]).appearanceTextColor = BraveUX.GreyJ
UIButton.appearance(whenContainedInInstancesOf: [AlertPopupView.self]).tintColor = .white

// EmptyPrivateTabsView
UILabel.appearance(whenContainedInInstancesOf: [EmptyPrivateTabsView.self]).appearanceTextColor = UIColor.Photon.Grey10
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class BackForwardListViewController: UIViewController, UITableViewDataSource, UI
tableView.alwaysBounceVertical = false
tableView.register(BackForwardTableViewCell.self, forCellReuseIdentifier: self.BackForwardListCellIdentifier)
tableView.backgroundColor = BackForwardViewUX.BackgroundColor
let blurEffect = UIBlurEffect(style: .extraLight)
let blurEffect = UIBlurEffect(style: .regular)
let blurEffectView = UIVisualEffectView(effect: blurEffect)
tableView.backgroundView = blurEffectView

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ extension OnboardingSearchEnginesViewController {
}

private let titleStackView = UIStackView().then { stackView in
stackView.spacing = 10
stackView.axis = .vertical
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ extension OnboardingSearchEnginesViewController: UITableViewDataSource {

cell.searchEngineName = searchEngine.shortName
cell.searchEngineImage = searchEngine.image
cell.selectedBackgroundColor = theme.colors.accent
cell.selectedBackgroundColor = dark ? UIColor(rgb: 0x495057) : UIColor(rgb: 0xF0F2FF)
cell.backgroundColor = .clear

if searchEngine == defaultEngine {
tableView.selectRow(at: indexPath, animated: true, scrollPosition: .middle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ class OnboardingViewController: UIViewController {
var profile: Profile
let theme: Theme

/// Whether the on-boarding is dark or not, based solely on passed in theme
/// Added explicitly to make removal easier in the future if just `theme` is used
var dark: Bool {
return theme.isDark
}

init(profile: Profile, theme: Theme) {
self.profile = profile
self.theme = theme
Expand All @@ -23,7 +29,7 @@ class OnboardingViewController: UIViewController {

override func viewDidLoad() {
super.viewDidLoad()
view.backgroundColor = theme.colors.home
view.backgroundColor = dark ? UIColor(rgb: 0x212529) : UIColor(rgb: 0xFFFFFF)
}

/// Default behavior to present next onboarding screen.
Expand Down
3 changes: 2 additions & 1 deletion Client/Frontend/Browser/TabTrayController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -963,7 +963,8 @@ private struct EmptyPrivateTabsViewUX {
}

// View we display when there are no private tabs created
fileprivate class EmptyPrivateTabsView: UIView {
// Need access for iOS 12 appearance adjustments
/*fileprivate*/ class EmptyPrivateTabsView: UIView {

let scrollView = UIScrollView().then {
$0.alwaysBounceVertical = true
Expand Down

0 comments on commit 5124fa8

Please # to comment.