Skip to content

Commit

Permalink
design system tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
brindy committed Nov 3, 2023
1 parent 860c20b commit 345f95f
Show file tree
Hide file tree
Showing 14 changed files with 22 additions and 37 deletions.
1 change: 0 additions & 1 deletion DuckDuckGo/AddressBarPositionSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion DuckDuckGo/AutoClearSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions DuckDuckGo/AutocompleteViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ extension AutocompleteViewController: UITableViewDataSource {

cell.backgroundColor = backgroundColor
cell.tintColor = currentTheme.autocompleteCellAccessoryColor
cell.setHighlightedStateBackgroundColor(currentTheme.tableCellHighlightedBackgroundColor)


return cell
}

Expand All @@ -255,7 +254,6 @@ extension AutocompleteViewController: UITableViewDataSource {

cell.tintColor = currentTheme.autocompleteCellAccessoryColor
cell.label?.textColor = currentTheme.tableCellTextColor
cell.setHighlightedStateBackgroundColor(currentTheme.tableCellHighlightedBackgroundColor)

return cell
}
Expand Down
15 changes: 15 additions & 0 deletions DuckDuckGo/AutofillLoginSettingsListViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,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
Expand Down
2 changes: 0 additions & 2 deletions DuckDuckGo/BookmarksViewControllerCells.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
}
Expand Down
1 change: 1 addition & 0 deletions DuckDuckGo/DarkTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ struct DarkTheme: Theme {

var destructiveColor: UIColor = UIColor.destructive

var searchBarBackgroundColor: UIColor = UIColor.charcoalGrey
}
1 change: 0 additions & 1 deletion DuckDuckGo/FeedbackPickerViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 0 additions & 1 deletion DuckDuckGo/FireButtonAnimationSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions DuckDuckGo/LightTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,5 @@ struct LightTheme: Theme {

var destructiveColor: UIColor = UIColor.destructive

var searchBarBackgroundColor: UIColor = UIColor.lightGreyish
}
1 change: 0 additions & 1 deletion DuckDuckGo/SettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,6 @@ 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)
}

override func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection: Int) {
Expand Down
5 changes: 2 additions & 3 deletions DuckDuckGo/Theme+DesignSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,18 @@ extension Theme {
var daxDialogTextColor: UIColor { UIColor(designSystemColor: .textPrimary) }

var placeholderColor: UIColor { UIColor(designSystemColor: .textSecondary) }

var searchBarBackgroundColor: UIColor { UIColor(designSystemColor: .container) }
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 tableCellTextColor: UIColor { UIColor(designSystemColor: .textPrimary) }

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
Expand Down
24 changes: 2 additions & 22 deletions DuckDuckGo/Theme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,19 +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 searchBarVoiceSearchIconColor: UIColor { get }
// var searchBarClearTextIconColor: UIColor { get }

var browsingMenuTextColor: UIColor { get }
var browsingMenuIconsColor: UIColor { get }
var browsingMenuBackgroundColor: UIColor { get }
Expand Down Expand Up @@ -103,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 }
Expand All @@ -122,15 +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 autofillEmptySearchViewTextColor: UIColor { get }
var autofillLockedViewTextColor: UIColor { get }

Expand Down
1 change: 0 additions & 1 deletion DuckDuckGo/ThemeSettingsViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion DuckDuckGo/UnprotectedSitesViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ class UnprotectedSitesViewController: UITableViewController {

let theme = enforceLightTheme ? LightTheme() : ThemeManager.shared.currentTheme
cell.backgroundColor = theme.tableCellBackgroundColor
cell.setHighlightedStateBackgroundColor(theme.tableCellHighlightedBackgroundColor)

return cell
}
Expand Down

0 comments on commit 345f95f

Please sign in to comment.