From 59dbb74d10ae5f0bd842b1a5c093dbfc4a604589 Mon Sep 17 00:00:00 2001 From: Christopher Brind Date: Wed, 29 Nov 2023 13:10:15 +0000 Subject: [PATCH] update theme to use system colours (#2180) --- ...essBarPositionSettingsViewController.swift | 1 - .../AutoClearSettingsViewController.swift | 1 - DuckDuckGo/AutocompleteViewController.swift | 4 +- ...ofillLoginSettingsListViewController.swift | 15 ++++ DuckDuckGo/Base.lproj/Bookmarks.storyboard | 5 +- DuckDuckGo/Base.lproj/LaunchScreen.storyboard | 15 ++-- DuckDuckGo/BookmarkDetailsCell.swift | 2 - DuckDuckGo/BookmarksViewControllerCells.swift | 2 - DuckDuckGo/DarkTheme.swift | 71 ++----------------- DuckDuckGo/FeedbackPickerViewController.swift | 1 - ...uttonAnimationSettingsViewController.swift | 1 - DuckDuckGo/LightTheme.swift | 69 ++---------------- DuckDuckGo/SettingsViewController.swift | 9 --- DuckDuckGo/Theme+DesignSystem.swift | 58 +++++++++++++++ DuckDuckGo/Theme.swift | 29 ++------ DuckDuckGo/ThemeManager.swift | 6 +- DuckDuckGo/ThemeSettingsViewController.swift | 1 - .../UnprotectedSitesViewController.swift | 1 - 18 files changed, 104 insertions(+), 187 deletions(-) diff --git a/DuckDuckGo/AddressBarPositionSettingsViewController.swift b/DuckDuckGo/AddressBarPositionSettingsViewController.swift index b7df80ab5e..34d8a466f4 100644 --- a/DuckDuckGo/AddressBarPositionSettingsViewController.swift +++ b/DuckDuckGo/AddressBarPositionSettingsViewController.swift @@ -43,7 +43,6 @@ class AddressBarPositionSettingsViewController: UITableViewController { override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { let theme = ThemeManager.shared.currentTheme cell.backgroundColor = theme.tableCellBackgroundColor - cell.setHighlightedStateBackgroundColor(theme.tableCellHighlightedBackgroundColor) cell.tintColor = theme.buttonTintColor cell.textLabel?.textColor = theme.tableCellTextColor diff --git a/DuckDuckGo/AutoClearSettingsViewController.swift b/DuckDuckGo/AutoClearSettingsViewController.swift index f46a1ccf1d..6f4363ff2d 100644 --- a/DuckDuckGo/AutoClearSettingsViewController.swift +++ b/DuckDuckGo/AutoClearSettingsViewController.swift @@ -114,7 +114,6 @@ class AutoClearSettingsViewController: UITableViewController { let theme = ThemeManager.shared.currentTheme cell.backgroundColor = theme.tableCellBackgroundColor - cell.setHighlightedStateBackgroundColor(theme.tableCellHighlightedBackgroundColor) // Checkmark color cell.tintColor = theme.buttonTintColor diff --git a/DuckDuckGo/AutocompleteViewController.swift b/DuckDuckGo/AutocompleteViewController.swift index cc13fc7ead..caa9e5b35a 100644 --- a/DuckDuckGo/AutocompleteViewController.swift +++ b/DuckDuckGo/AutocompleteViewController.swift @@ -237,8 +237,7 @@ extension AutocompleteViewController: UITableViewDataSource { cell.backgroundColor = backgroundColor cell.tintColor = currentTheme.autocompleteCellAccessoryColor - cell.setHighlightedStateBackgroundColor(currentTheme.tableCellHighlightedBackgroundColor) - + return cell } @@ -255,7 +254,6 @@ extension AutocompleteViewController: UITableViewDataSource { cell.tintColor = currentTheme.autocompleteCellAccessoryColor cell.label?.textColor = currentTheme.tableCellTextColor - cell.setHighlightedStateBackgroundColor(currentTheme.tableCellHighlightedBackgroundColor) return cell } diff --git a/DuckDuckGo/AutofillLoginSettingsListViewController.swift b/DuckDuckGo/AutofillLoginSettingsListViewController.swift index aa1966ef0f..3c7d0f86a8 100644 --- a/DuckDuckGo/AutofillLoginSettingsListViewController.swift +++ b/DuckDuckGo/AutofillLoginSettingsListViewController.swift @@ -552,6 +552,21 @@ extension AutofillLoginSettingsListViewController: UITableViewDelegate { return 0 } } + + func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection: Int) { + if let view = view as? UITableViewHeaderFooterView { + let theme = ThemeManager.shared.currentTheme + view.textLabel?.textColor = theme.tableHeaderTextColor + } + } + + func tableView(_ tableView: UITableView, willDisplayFooterView view: UIView, forSection: Int) { + if let view = view as? UITableViewHeaderFooterView { + let theme = ThemeManager.shared.currentTheme + view.textLabel?.textColor = theme.tableHeaderTextColor + } + } + } // MARK: UITableViewDataSource diff --git a/DuckDuckGo/Base.lproj/Bookmarks.storyboard b/DuckDuckGo/Base.lproj/Bookmarks.storyboard index 8db08cb51a..cf28e50f78 100644 --- a/DuckDuckGo/Base.lproj/Bookmarks.storyboard +++ b/DuckDuckGo/Base.lproj/Bookmarks.storyboard @@ -561,10 +561,10 @@ - + - + @@ -587,7 +587,6 @@ - diff --git a/DuckDuckGo/Base.lproj/LaunchScreen.storyboard b/DuckDuckGo/Base.lproj/LaunchScreen.storyboard index 6f667974a3..b1af175bf8 100644 --- a/DuckDuckGo/Base.lproj/LaunchScreen.storyboard +++ b/DuckDuckGo/Base.lproj/LaunchScreen.storyboard @@ -1,9 +1,10 @@ - + - + + @@ -25,11 +26,11 @@ - + - + @@ -47,5 +48,11 @@ + + + + + + diff --git a/DuckDuckGo/BookmarkDetailsCell.swift b/DuckDuckGo/BookmarkDetailsCell.swift index 6e037b3a46..c6cc3dce9b 100644 --- a/DuckDuckGo/BookmarkDetailsCell.swift +++ b/DuckDuckGo/BookmarkDetailsCell.swift @@ -52,12 +52,10 @@ class BookmarkDetailsCell: UITableViewCell { @IBOutlet weak var titleTextField: UITextField! @IBOutlet weak var urlTextField: UITextField! @IBOutlet weak var faviconImageView: UIImageView! - @IBOutlet weak var seperatorViewHeight: NSLayoutConstraint! func setUp() { selectionStyle = .none - seperatorViewHeight.constant = 1.0 / UIScreen.main.scale titleTextField.becomeFirstResponder() titleTextField.removeTarget(self, action: #selector(textFieldDidChange(_:)), for: .editingChanged) diff --git a/DuckDuckGo/BookmarksViewControllerCells.swift b/DuckDuckGo/BookmarksViewControllerCells.swift index 7cb16c799b..27b231fe19 100644 --- a/DuckDuckGo/BookmarksViewControllerCells.swift +++ b/DuckDuckGo/BookmarksViewControllerCells.swift @@ -76,7 +76,6 @@ class BookmarksViewControllerCellFactory { let theme = ThemeManager.shared.currentTheme cell.backgroundColor = theme.tableCellBackgroundColor cell.titleLabel.textColor = theme.tableCellTextColor - cell.setHighlightedStateBackgroundColor(theme.tableCellHighlightedBackgroundColor) cell.favoriteImageView.tintColor = UIColor(designSystemColor: .icons) cell.editingAccessoryType = .disclosureIndicator return cell @@ -91,7 +90,6 @@ class BookmarksViewControllerCellFactory { cell.backgroundColor = theme.tableCellBackgroundColor cell.titleLabel.textColor = theme.tableCellTextColor cell.childrenCountLabel.textColor = theme.tableCellTextColor - cell.setHighlightedStateBackgroundColor(theme.tableCellHighlightedBackgroundColor) cell.editingAccessoryType = .disclosureIndicator return cell } diff --git a/DuckDuckGo/DarkTheme.swift b/DuckDuckGo/DarkTheme.swift index 52ec2eece9..6ca267eba7 100644 --- a/DuckDuckGo/DarkTheme.swift +++ b/DuckDuckGo/DarkTheme.swift @@ -32,93 +32,34 @@ struct DarkTheme: Theme { var tabsBarBackgroundColor = UIColor.black var tabsBarSeparatorColor = UIColor.darkGreyish - var navigationBarTitleColor = UIColor.white var navigationBarTintColor = UIColor.lightMercury - - var tintOnBlurColor = UIColor.white - - var searchBarBackgroundColor = UIColor.charcoalGrey + var centeredSearchBarBackgroundColor = UIColor.nearlyBlackLight - var searchBarTextColor = UIColor.white var searchBarTextDeemphasisColor = UIColor.lightMercury - var searchBarBorderColor = UIColor.darkGreyish - var searchBarClearTextIconColor = UIColor.greyish2 - var searchBarVoiceSearchIconColor = UIColor.greyish2 - - var browsingMenuTextColor = UIColor.white - var browsingMenuIconsColor = UIColor.gray20 - var browsingMenuSeparatorColor = UIColor.charcoalGrey - var browsingMenuHighlightColor = UIColor.darkGreyish - - var progressBarGradientDarkColor = UIColor.orange - var progressBarGradientLightColor = UIColor.orangeLight - - var autocompleteSuggestionTextColor = UIColor.white - var autocompleteCellAccessoryColor = UIColor.lightMercury + var browsingMenuHighlightColor = UIColor.darkGreyish + var tableCellSelectedColor = UIColor.charcoalGrey - var tableCellSeparatorColor = UIColor.charcoalGrey - var tableCellTextColor = UIColor.lightGreyish - var tableCellAccessoryTextColor = UIColor.greyish var tableCellAccessoryColor = UIColor.greyish3 var tableCellHighlightedBackgroundColor = UIColor.greyishBrown - var tableHeaderTextColor = UIColor.greyish3 var tabSwitcherCellBorderColor = UIColor.white var tabSwitcherCellTextColor = UIColor.white var tabSwitcherCellSecondaryTextColor = UIColor.lightMercury - - var iconCellBorderColor = UIColor.lightGreyish - - var buttonTintColor = UIColor.cornflowerBlue - var placeholderColor = UIColor.greyish - - var textFieldBackgroundColor = UIColor.nearlyBlackLight - var textFieldFontColor = UIColor.white - + var homeRowPrimaryTextColor = UIColor.white var homeRowSecondaryTextColor = UIColor.lightMercury var homeRowBackgroundColor = UIColor.nearlyBlackLight var homePrivacyCellTextColor = UIColor.white var homePrivacyCellSecondaryTextColor = UIColor.greyish3 - - var aboutScreenTextColor = UIColor.white - var aboutScreenButtonColor = UIColor.cornflowerBlue - + var favoritesPlusTintColor = UIColor.greyish3 var favoritesPlusBackgroundColor = UIColor.greyishBrown2 - var faviconBackgroundColor = UIColor.charcoalGrey - var favoriteTextColor = UIColor.greyish - - var feedbackPrimaryTextColor = UIColor.white - var feedbackSecondaryTextColor = UIColor.lightGreyish - var feedbackSentimentButtonBackgroundColor = UIColor.charcoalGrey - - var privacyReportCellBackgroundColor = UIColor.nearlyBlackLight - var activityStyle: UIActivityIndicatorView.Style = .medium var destructiveColor: UIColor = UIColor.destructive - - var ddgTextTintColor: UIColor = .white - - var daxDialogBackgroundColor: UIColor = .nearlyBlackLight - var daxDialogTextColor: UIColor = UIColor.nearlyWhite - - var homeMessageBackgroundColor = UIColor.nearlyBlackLight - var homeMessageHeaderTextColor = UIColor.white - var homeMessageSubheaderTextColor = UIColor.greyish2 - var homeMessageTopTextColor = UIColor.cornflowerBlue - var homeMessageButtonColor = UIColor.cornflowerBlue - var homeMessageButtonTextColor = UIColor.white - var homeMessageDismissButtonColor = UIColor.white - - var autofillDefaultTitleTextColor = UIColor.white - var autofillDefaultSubtitleTextColor = UIColor.lightMercury - var autofillEmptySearchViewTextColor = UIColor.gray20 - var autofillLockedViewTextColor = UIColor.lightMercury - var privacyDashboardWebviewBackgroundColor = UIColor.nearlyBlackLight + var searchBarBackgroundColor: UIColor = UIColor.charcoalGrey } diff --git a/DuckDuckGo/FeedbackPickerViewController.swift b/DuckDuckGo/FeedbackPickerViewController.swift index 898f0d095a..96169a4169 100644 --- a/DuckDuckGo/FeedbackPickerViewController.swift +++ b/DuckDuckGo/FeedbackPickerViewController.swift @@ -117,7 +117,6 @@ class FeedbackPickerViewController: UITableViewController { let theme = ThemeManager.shared.currentTheme cell.backgroundColor = theme.tableCellBackgroundColor cell.textLabel?.textColor = theme.tableCellTextColor - cell.setHighlightedStateBackgroundColor(theme.tableCellHighlightedBackgroundColor) let text = cell.textLabel?.attributedText?.mutableCopy() as? NSMutableAttributedString text?.mutableString.setString(entries[indexPath.row].userText) diff --git a/DuckDuckGo/FireButtonAnimationSettingsViewController.swift b/DuckDuckGo/FireButtonAnimationSettingsViewController.swift index b96853515e..94b2ae8cd9 100644 --- a/DuckDuckGo/FireButtonAnimationSettingsViewController.swift +++ b/DuckDuckGo/FireButtonAnimationSettingsViewController.swift @@ -49,7 +49,6 @@ class FireButtonAnimationSettingsViewController: UITableViewController { let theme = ThemeManager.shared.currentTheme cell.backgroundColor = theme.tableCellBackgroundColor - cell.setHighlightedStateBackgroundColor(theme.tableCellHighlightedBackgroundColor) // Checkmark color cell.tintColor = theme.buttonTintColor diff --git a/DuckDuckGo/LightTheme.swift b/DuckDuckGo/LightTheme.swift index 465680947a..7c90ed2b5d 100644 --- a/DuckDuckGo/LightTheme.swift +++ b/DuckDuckGo/LightTheme.swift @@ -33,94 +33,33 @@ struct LightTheme: Theme { var tabsBarBackgroundColor = UIColor.gray20 var tabsBarSeparatorColor = UIColor.greyish - - var navigationBarTitleColor = UIColor.nearlyBlackLight var navigationBarTintColor = UIColor.darkGreyish - var tintOnBlurColor = UIColor.white - - var searchBarBackgroundColor = UIColor.lightGreyish - var centeredSearchBarBackgroundColor = UIColor.mercury - var searchBarTextColor = UIColor.nearlyBlackLight var searchBarTextDeemphasisColor = UIColor.greyish3 - var searchBarBorderColor = UIColor.lightGreyish - var searchBarClearTextIconColor = UIColor.greyish2 - var searchBarVoiceSearchIconColor = UIColor.greyish2 - - var browsingMenuTextColor = UIColor.nearlyBlack - var browsingMenuIconsColor = UIColor.nearlyBlackLight - var browsingMenuSeparatorColor = UIColor.mercury - var browsingMenuHighlightColor = UIColor.lightGreyish - - var progressBarGradientDarkColor = UIColor.cornflowerBlue - var progressBarGradientLightColor = UIColor.skyBlueLight - var autocompleteSuggestionTextColor = UIColor.black - var autocompleteCellAccessoryColor = UIColor.darkGreyish + var browsingMenuHighlightColor = UIColor.lightGreyish var tableCellSelectedColor = UIColor.mercury - var tableCellSeparatorColor = UIColor(white: 0, alpha: 0.09) - var tableCellTextColor = UIColor.darkGreyish - var tableCellAccessoryTextColor = UIColor.greyish3 var tableCellAccessoryColor = UIColor.greyish var tableCellHighlightedBackgroundColor = UIColor.mercury - var tableHeaderTextColor = UIColor.greyish3 var tabSwitcherCellBorderColor = UIColor.nearlyBlackLight var tabSwitcherCellTextColor = UIColor.black var tabSwitcherCellSecondaryTextColor = UIColor.greyishBrown2 - - var iconCellBorderColor = UIColor.darkGreyish - var buttonTintColor = UIColor.cornflowerBlue - var placeholderColor = UIColor.greyish3 - - var textFieldBackgroundColor = UIColor.white - var textFieldFontColor = UIColor.nearlyBlackLight - var homeRowPrimaryTextColor = UIColor.nearlyBlackLight var homeRowSecondaryTextColor = UIColor.greyishBrown2 var homeRowBackgroundColor = UIColor.nearlyWhiteLight var homePrivacyCellTextColor = UIColor.charcoalGrey var homePrivacyCellSecondaryTextColor = UIColor.greyish3 - - var aboutScreenTextColor = UIColor.charcoalGrey - var aboutScreenButtonColor = UIColor.cornflowerBlue - + var favoritesPlusTintColor = UIColor.greyish3 var favoritesPlusBackgroundColor = UIColor.lightMercury - - var faviconBackgroundColor = UIColor.white - var favoriteTextColor = UIColor.darkGreyish - - var feedbackPrimaryTextColor = UIColor.nearlyBlackLight - var feedbackSecondaryTextColor = UIColor.nearlyBlackLight - var feedbackSentimentButtonBackgroundColor = UIColor.white - - var privacyReportCellBackgroundColor = UIColor.white - + var activityStyle: UIActivityIndicatorView.Style = .medium var destructiveColor: UIColor = UIColor.destructive - - var ddgTextTintColor: UIColor = UIColor.nearlyBlackLight - - var daxDialogBackgroundColor: UIColor = UIColor.white - var daxDialogTextColor: UIColor = UIColor.darkGreyish - - var homeMessageBackgroundColor = UIColor.white - var homeMessageHeaderTextColor = UIColor.black - var homeMessageSubheaderTextColor = UIColor.greyish3 - var homeMessageTopTextColor = UIColor.cornflowerBlue - var homeMessageButtonColor = UIColor.cornflowerBlue - var homeMessageButtonTextColor = UIColor.white - var homeMessageDismissButtonColor = UIColor.nearlyBlackLight - - var autofillDefaultTitleTextColor = UIColor.nearlyBlack - var autofillDefaultSubtitleTextColor = UIColor.greyishBrown2 - var autofillEmptySearchViewTextColor = UIColor.gray50 - var autofillLockedViewTextColor = UIColor.nearlyBlack - var privacyDashboardWebviewBackgroundColor = UIColor.white + var searchBarBackgroundColor: UIColor = UIColor.lightGreyish } diff --git a/DuckDuckGo/SettingsViewController.swift b/DuckDuckGo/SettingsViewController.swift index 0f52a73f5a..42bc7ae375 100644 --- a/DuckDuckGo/SettingsViewController.swift +++ b/DuckDuckGo/SettingsViewController.swift @@ -510,17 +510,8 @@ class SettingsViewController: UITableViewController { } override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) { - let theme = ThemeManager.shared.currentTheme cell.backgroundColor = theme.tableCellBackgroundColor - cell.setHighlightedStateBackgroundColor(theme.tableCellHighlightedBackgroundColor) - - if cell.accessoryType == .disclosureIndicator { - let accesoryImage = UIImageView(image: UIImage(named: "DisclosureIndicator")) - accesoryImage.frame = CGRect(x: 0, y: 0, width: 8, height: 13) - accesoryImage.tintColor = theme.tableCellAccessoryColor - cell.accessoryView = accesoryImage - } } override func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection: Int) { diff --git a/DuckDuckGo/Theme+DesignSystem.swift b/DuckDuckGo/Theme+DesignSystem.swift index f52d2e923e..d496616332 100644 --- a/DuckDuckGo/Theme+DesignSystem.swift +++ b/DuckDuckGo/Theme+DesignSystem.swift @@ -33,4 +33,62 @@ extension Theme { var tabSwitcherCellBackgroundColor: UIColor { UIColor(designSystemColor: .surface) } var searchBarTextPlaceholderColor: UIColor { UIColor(designSystemColor: .textSecondary) } + // New: + var autocompleteCellAccessoryColor: UIColor { UIColor(designSystemColor: .icons) } + + var autofillDefaultTitleTextColor: UIColor { UIColor(designSystemColor: .textPrimary) } + var autofillDefaultSubtitleTextColor: UIColor { UIColor(designSystemColor: .textSecondary) } + var autofillEmptySearchViewTextColor: UIColor { UIColor(designSystemColor: .textPrimary) } + var autofillLockedViewTextColor: UIColor { UIColor(designSystemColor: .textPrimary) } + + var ddgTextTintColor: UIColor { UIColor(designSystemColor: .textPrimary) } + + var privacyDashboardWebviewBackgroundColor: UIColor { UIColor(designSystemColor: .surface) } + + var iconCellBorderColor: UIColor { UIColor(designSystemColor: .icons) } + + var browsingMenuTextColor: UIColor { UIColor(designSystemColor: .textPrimary) } + var browsingMenuIconsColor: UIColor { UIColor(designSystemColor: .textPrimary) } + var browsingMenuSeparatorColor: UIColor { UIColor(designSystemColor: .lines) } + + var feedbackSentimentButtonBackgroundColor: UIColor { UIColor(designSystemColor: .surface) } + + var aboutScreenButtonColor: UIColor { UIColor(designSystemColor: .accent) } + + var tabSwitcherCellBorderColor: UIColor { UIColor(designSystemColor: .surface) } + var tabSwitcherCellTextColor: UIColor { UIColor(designSystemColor: .textPrimary) } + var tabSwitcherCellSecondaryTextColor: UIColor { UIColor(designSystemColor: .textSecondary) } + + var textFieldFontColor: UIColor { UIColor(designSystemColor: .textPrimary) } + var textFieldBackgroundColor: UIColor { UIColor(designSystemColor: .surface) } + + var buttonTintColor: UIColor { UIColor(designSystemColor: .accent) } + + var feedbackPrimaryTextColor: UIColor { UIColor(designSystemColor: .textPrimary) } + var feedbackSecondaryTextColor: UIColor { UIColor(designSystemColor: .textSecondary) } + + var progressBarGradientDarkColor: UIColor { UIColor(designSystemColor: .accent) } + var progressBarGradientLightColor: UIColor { UIColor(designSystemColor: .accent) } + + var daxDialogBackgroundColor: UIColor { UIColor(designSystemColor: .surface) } + var daxDialogTextColor: UIColor { UIColor(designSystemColor: .textPrimary) } + + var placeholderColor: UIColor { UIColor(designSystemColor: .textSecondary) } + var searchBarTextColor: UIColor { UIColor(designSystemColor: .textPrimary) } + + var navigationBarTitleColor: UIColor { UIColor(designSystemColor: .textPrimary) } + var tableHeaderTextColor: UIColor {UIColor(designSystemColor: .textSecondary) } + + var faviconBackgroundColor: UIColor { UIColor(designSystemColor: .surface) } + + var favoriteTextColor: UIColor { UIColor(designSystemColor: .textSecondary) } + var aboutScreenTextColor: UIColor { UIColor(designSystemColor: .textPrimary) } + var autocompleteSuggestionTextColor: UIColor { UIColor(designSystemColor: .textPrimary) } + + var tableCellTextColor: UIColor { UIColor(designSystemColor: .textPrimary) } + var tableCellSeparatorColor: UIColor { UIColor(designSystemColor: .lines) } + + // No design system colour yet, so fall back to SDK colours + var tableCellAccessoryTextColor: UIColor { .secondaryLabel } + } diff --git a/DuckDuckGo/Theme.swift b/DuckDuckGo/Theme.swift index 063920f72e..e145c51444 100644 --- a/DuckDuckGo/Theme.swift +++ b/DuckDuckGo/Theme.swift @@ -46,18 +46,11 @@ protocol Theme { var navigationBarTitleColor: UIColor { get } var navigationBarTintColor: UIColor { get } - // Color of the content that is directly placed over blurred background - var tintOnBlurColor: UIColor { get } - var searchBarBackgroundColor: UIColor { get } - var centeredSearchBarBackgroundColor: UIColor { get } var searchBarTextColor: UIColor { get } var searchBarTextPlaceholderColor: UIColor { get } var searchBarTextDeemphasisColor: UIColor { get } - var searchBarBorderColor: UIColor { get } - var searchBarClearTextIconColor: UIColor { get } - var searchBarVoiceSearchIconColor: UIColor { get } - + var browsingMenuTextColor: UIColor { get } var browsingMenuIconsColor: UIColor { get } var browsingMenuBackgroundColor: UIColor { get } @@ -69,7 +62,7 @@ protocol Theme { var autocompleteSuggestionTextColor: UIColor { get } var autocompleteCellAccessoryColor: UIColor { get } - + var tableCellBackgroundColor: UIColor { get } var tableCellSelectedColor: UIColor { get } var tableCellSeparatorColor: UIColor { get } @@ -102,17 +95,13 @@ protocol Theme { var aboutScreenTextColor: UIColor { get } var aboutScreenButtonColor: UIColor { get } - var favoritesPlusTintColor: UIColor { get } - var favoritesPlusBackgroundColor: UIColor { get } var faviconBackgroundColor: UIColor { get } var favoriteTextColor: UIColor { get } var feedbackPrimaryTextColor: UIColor { get } var feedbackSecondaryTextColor: UIColor { get } var feedbackSentimentButtonBackgroundColor: UIColor { get } - - var privacyReportCellBackgroundColor: UIColor { get } - + var activityStyle: UIActivityIndicatorView.Style { get } var destructiveColor: UIColor { get } @@ -121,17 +110,7 @@ protocol Theme { var daxDialogBackgroundColor: UIColor { get } var daxDialogTextColor: UIColor { get } - - var homeMessageBackgroundColor: UIColor { get } - var homeMessageHeaderTextColor: UIColor { get } - var homeMessageSubheaderTextColor: UIColor { get } - var homeMessageTopTextColor: UIColor { get } - var homeMessageButtonColor: UIColor { get } - var homeMessageButtonTextColor: UIColor { get } - var homeMessageDismissButtonColor: UIColor { get } - - var autofillDefaultTitleTextColor: UIColor { get } - var autofillDefaultSubtitleTextColor: UIColor { get } + var autofillEmptySearchViewTextColor: UIColor { get } var autofillLockedViewTextColor: UIColor { get } diff --git a/DuckDuckGo/ThemeManager.swift b/DuckDuckGo/ThemeManager.swift index a788a252b8..1a764b755e 100644 --- a/DuckDuckGo/ThemeManager.swift +++ b/DuckDuckGo/ThemeManager.swift @@ -57,8 +57,9 @@ class ThemeManager { } } } - - private static func makeTheme(name: ThemeName) -> Theme { + + public static func makeTheme(name: ThemeName) -> Theme { + switch name { case .systemDefault: return obtainSystemTheme() @@ -66,7 +67,6 @@ class ThemeManager { return DarkTheme() case .light: return LightTheme() - } } diff --git a/DuckDuckGo/ThemeSettingsViewController.swift b/DuckDuckGo/ThemeSettingsViewController.swift index 4879cca3a2..81a0a874e1 100644 --- a/DuckDuckGo/ThemeSettingsViewController.swift +++ b/DuckDuckGo/ThemeSettingsViewController.swift @@ -55,7 +55,6 @@ class ThemeSettingsViewController: UITableViewController { let theme = ThemeManager.shared.currentTheme cell.backgroundColor = theme.tableCellBackgroundColor - cell.setHighlightedStateBackgroundColor(theme.tableCellHighlightedBackgroundColor) // Checkmark color cell.tintColor = theme.buttonTintColor diff --git a/DuckDuckGo/UnprotectedSitesViewController.swift b/DuckDuckGo/UnprotectedSitesViewController.swift index 94a1c03d5c..9a25969853 100644 --- a/DuckDuckGo/UnprotectedSitesViewController.swift +++ b/DuckDuckGo/UnprotectedSitesViewController.swift @@ -222,7 +222,6 @@ class UnprotectedSitesViewController: UITableViewController { let theme = enforceLightTheme ? LightTheme() : ThemeManager.shared.currentTheme cell.backgroundColor = theme.tableCellBackgroundColor - cell.setHighlightedStateBackgroundColor(theme.tableCellHighlightedBackgroundColor) return cell }