Skip to content

Commit

Permalink
Refactor FXIOS-7778 [v122] Theming to match design system (#17402)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyndichin authored Nov 21, 2023
1 parent a558fbc commit 71ccced
Show file tree
Hide file tree
Showing 8 changed files with 2 additions and 11 deletions.
1 change: 0 additions & 1 deletion BrowserKit/Sources/Common/Theming/DarkTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ private struct DarkColourPalette: ThemeColourPalette {
// MARK: - Text
var textPrimary: UIColor = FXColors.LightGrey05
var textSecondary: UIColor = FXColors.LightGrey40
var textSecondaryAction: UIColor = FXColors.DarkGrey90
var textDisabled: UIColor = FXColors.LightGrey05.withAlphaComponent(0.4)
var textWarning: UIColor = FXColors.Red20
var textAccent: UIColor = FXColors.Blue30
Expand Down
4 changes: 0 additions & 4 deletions BrowserKit/Sources/Common/Theming/DefaultThemeManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ public final class DefaultThemeManager: ThemeManager, Notifiable {

// MARK: - ThemeManager

public func getInterfaceStyle() -> UIUserInterfaceStyle {
return currentTheme.type.getInterfaceStyle()
}

public func changeCurrentTheme(_ newTheme: ThemeType) {
guard currentTheme.type != newTheme else { return }
currentTheme = newThemeForType(newTheme)
Expand Down
1 change: 0 additions & 1 deletion BrowserKit/Sources/Common/Theming/LightTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ private struct LightColourPalette: ThemeColourPalette {
// MARK: - Text
var textPrimary: UIColor = FXColors.DarkGrey90
var textSecondary: UIColor = FXColors.DarkGrey05
var textSecondaryAction: UIColor = FXColors.DarkGrey90
var textDisabled: UIColor = FXColors.DarkGrey90.withAlphaComponent(0.4)
var textWarning: UIColor = FXColors.Red70
var textAccent: UIColor = FXColors.Blue50
Expand Down
1 change: 0 additions & 1 deletion BrowserKit/Sources/Common/Theming/PrivateModeTheme.swift
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ private struct PrivateModeColorPalette: ThemeColourPalette {
// MARK: - Text
var textPrimary: UIColor = FXColors.LightGrey05
var textSecondary: UIColor = FXColors.LightGrey40
var textSecondaryAction: UIColor = FXColors.DarkGrey90
var textDisabled: UIColor = FXColors.LightGrey05.withAlphaComponent(0.4)
var textWarning: UIColor = FXColors.Red20
var textAccent: UIColor = FXColors.Blue30
Expand Down
1 change: 0 additions & 1 deletion BrowserKit/Sources/Common/Theming/ThemeColourPalette.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public protocol ThemeColourPalette {
// MARK: - Text
var textPrimary: UIColor { get }
var textSecondary: UIColor { get }
var textSecondaryAction: UIColor { get }
var textDisabled: UIColor { get }
var textWarning: UIColor { get }
var textAccent: UIColor { get }
Expand Down
1 change: 0 additions & 1 deletion BrowserKit/Sources/Common/Theming/ThemeManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public protocol ThemeManager {
var currentTheme: Theme { get }
var window: UIWindow? { get set }

func getInterfaceStyle() -> UIUserInterfaceStyle
func changeCurrentTheme(_ newTheme: ThemeType)
func systemThemeChanged()
func setSystemTheme(isOn: Bool)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class SecondaryRoundedButton: ResizableButton, ThemeApplicable {
highlightedTintColor = theme.colors.actionSecondaryHover
normalTintColor = theme.colors.actionSecondary

setTitleColor(theme.colors.textSecondaryAction, for: .normal)
setTitleColor(theme.colors.textOnLight, for: .normal)
backgroundColor = theme.colors.actionSecondary
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ class SurveySurfaceViewController: UIViewController, Themeable {
takeSurveyButton.setTitleColor(theme.colors.textInverted, for: .normal)
takeSurveyButton.backgroundColor = theme.colors.actionPrimary

dismissSurveyButton.setTitleColor(theme.colors.textSecondaryAction, for: .normal)
dismissSurveyButton.setTitleColor(theme.colors.textOnLight, for: .normal)
dismissSurveyButton.backgroundColor = theme.colors.actionSecondary
}
}

0 comments on commit 71ccced

Please sign in to comment.