From 85a2d1b88f9fe4383c1a9ca35f83d1a46b4441ef Mon Sep 17 00:00:00 2001 From: Chris Brind Date: Mon, 9 Oct 2023 12:05:23 +0100 Subject: [PATCH] some design / bug fixes --- .../xcshareddata/swiftpm/Package.resolved | 2 +- DuckDuckGo/AutocompleteViewController.swift | 4 ++-- DuckDuckGo/MainView.swift | 6 +++--- DuckDuckGo/MainViewController.swift | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index ce52c2c554..5c480b0877 100644 --- a/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/DuckDuckGo.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -156,7 +156,7 @@ }, { "package": "TrackerRadarKit", - "repositoryURL": "https://github.com/duckduckgo/TrackerRadarKit.git", + "repositoryURL": "https://github.com/duckduckgo/TrackerRadarKit", "state": { "branch": null, "revision": "4684440d03304e7638a2c8086895367e90987463", diff --git a/DuckDuckGo/AutocompleteViewController.swift b/DuckDuckGo/AutocompleteViewController.swift index 04d7d58017..8a5db3e470 100644 --- a/DuckDuckGo/AutocompleteViewController.swift +++ b/DuckDuckGo/AutocompleteViewController.swift @@ -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 } diff --git a/DuckDuckGo/MainView.swift b/DuckDuckGo/MainView.swift index 02f54e3b27..cbb4550f56 100644 --- a/DuckDuckGo/MainView.swift +++ b/DuckDuckGo/MainView.swift @@ -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 @@ -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) } diff --git a/DuckDuckGo/MainViewController.swift b/DuckDuckGo/MainViewController.swift index e6d0bf7773..e945858f40 100644 --- a/DuckDuckGo/MainViewController.swift +++ b/DuckDuckGo/MainViewController.swift @@ -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() @@ -901,7 +901,7 @@ class MainViewController: UIViewController { if !DaxDialogs.shared.shouldShowFireButtonPulse { ViewHighlighter.hideAll() } - if type.hideOmnibarSeparator() { + if type.hideOmnibarSeparator() && appSettings.currentAddressBarPosition == .top { omniBar.hideSeparator() } }