Skip to content

Commit

Permalink
some design / bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brindy committed Oct 9, 2023
1 parent 03215a5 commit 85a2d1b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
},
{
"package": "TrackerRadarKit",
"repositoryURL": "https://github.com/duckduckgo/TrackerRadarKit.git",
"repositoryURL": "https://github.com/duckduckgo/TrackerRadarKit",
"state": {
"branch": null,
"revision": "4684440d03304e7638a2c8086895367e90987463",
Expand Down
4 changes: 2 additions & 2 deletions DuckDuckGo/AutocompleteViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,11 @@ extension AutocompleteViewController: UITableViewDataSource {
}

let currentTheme = ThemeManager.shared.currentTheme
cell.backgroundColor = UIColor(designSystemColor: .panel)
cell.backgroundColor = isAddressBarAtBottom ? UIColor(designSystemColor: .background) : UIColor(designSystemColor: .panel)
cell.tintColor = currentTheme.autocompleteCellAccessoryColor
cell.label?.textColor = currentTheme.tableCellTextColor
cell.setHighlightedStateBackgroundColor(currentTheme.tableCellHighlightedBackgroundColor)

return cell
}

Expand Down
6 changes: 3 additions & 3 deletions DuckDuckGo/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ class MainViewCoordinator {

// The default after creating the hiearchy is top
var addressBarPosition: AddressBarPosition = .top
var toolbarImage: UIImage?

fileprivate init(superview: UIView) {
self.superview = superview
Expand All @@ -337,13 +338,12 @@ class MainViewCoordinator {
}

func showToolbarSeparator() {
// Setting the background 'resets' the toolbar
toolbar.setBackgroundImage(nil, forToolbarPosition: .bottom, barMetrics: .default)
toolbar.setShadowImage(nil, forToolbarPosition: .bottom)
toolbar.setShadowImage(toolbarImage, forToolbarPosition: .bottom)
}

func hideToolbarSeparator() {
// The shadow image is what defines the separator, but we don't need to change the background here (in fact we want to keep it).
toolbarImage = toolbar.shadowImage(forToolbarPosition: .bottom)
toolbar.setShadowImage(UIImage(), forToolbarPosition: .bottom)
}

Expand Down
4 changes: 2 additions & 2 deletions DuckDuckGo/MainViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,11 @@ class MainViewController: UIViewController {
}

func refreshViewsBasedOnAddressBarPosition() {
// TODO update any other view elements
switch appSettings.currentAddressBarPosition {
case .top:
omniBar.moveSeparatorToBottom()
viewCoordinator.showToolbarSeparator()

case .bottom:
omniBar.moveSeparatorToTop()
viewCoordinator.hideToolbarSeparator()
Expand Down Expand Up @@ -901,7 +901,7 @@ class MainViewController: UIViewController {
if !DaxDialogs.shared.shouldShowFireButtonPulse {
ViewHighlighter.hideAll()
}
if type.hideOmnibarSeparator() {
if type.hideOmnibarSeparator() && appSettings.currentAddressBarPosition == .top {
omniBar.hideSeparator()
}
}
Expand Down

0 comments on commit 85a2d1b

Please sign in to comment.