From 71116e89a387900080b19c47e511bff23ccdd7a6 Mon Sep 17 00:00:00 2001 From: Ted Su <98071325+tisumi99@users.noreply.github.com> Date: Thu, 23 May 2024 09:35:42 -0700 Subject: [PATCH] Refactor FXIOS-9165 [Fonts] - Updated Fonts On SettingsViewController to FXFontStyles (#20323) --- .../Settings/ContentBlockerSettingViewController.swift | 2 +- .../Frontend/Settings/SettingsTableViewController.swift | 7 +------ .../Settings/ThemeSettings/ThemeSettingsController.swift | 4 +--- 3 files changed, 3 insertions(+), 10 deletions(-) diff --git a/firefox-ios/Client/Frontend/Settings/ContentBlockerSettingViewController.swift b/firefox-ios/Client/Frontend/Settings/ContentBlockerSettingViewController.swift index e2d4cb8f6c1c..ab0c61aadc69 100644 --- a/firefox-ios/Client/Frontend/Settings/ContentBlockerSettingViewController.swift +++ b/firefox-ios/Client/Frontend/Settings/ContentBlockerSettingViewController.swift @@ -149,7 +149,7 @@ class ContentBlockerSettingViewController: SettingsTableViewController { let title: String = .TrackerProtectionLearnMore let theme = themeManager.currentTheme(for: windowUUID) - let font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .subheadline, size: 12.0) + let font = FXFontStyles.Regular.caption1.scaledFont() var attributes = [NSAttributedString.Key: AnyObject]() attributes[NSAttributedString.Key.foregroundColor] = theme.colors.actionPrimary attributes[NSAttributedString.Key.font] = font diff --git a/firefox-ios/Client/Frontend/Settings/SettingsTableViewController.swift b/firefox-ios/Client/Frontend/Settings/SettingsTableViewController.swift index 48b34a5ec722..df1f823c45ce 100644 --- a/firefox-ios/Client/Frontend/Settings/SettingsTableViewController.swift +++ b/firefox-ios/Client/Frontend/Settings/SettingsTableViewController.swift @@ -507,7 +507,6 @@ class StringSetting: Setting, UITextFieldDelegate { private struct UX { static let padding: CGFloat = 15 static let textFieldHeight: CGFloat = 44 - static let fontSize: CGFloat = 17 static let textFieldIdentifierSuffix = "TextField" } @@ -575,11 +574,7 @@ class StringSetting: Setting, UITextFieldDelegate { cell.accessibilityTraits = UIAccessibilityTraits.none cell.contentView.addSubview(textField) - textField.font = DefaultDynamicFontHelper.preferredFont( - withTextStyle: .body, - size: UX.fontSize, - weight: .regular - ) + textField.font = FXFontStyles.Regular.body.scaledFont() NSLayoutConstraint.activate( [ diff --git a/firefox-ios/Client/Frontend/Settings/ThemeSettings/ThemeSettingsController.swift b/firefox-ios/Client/Frontend/Settings/ThemeSettings/ThemeSettingsController.swift index 0c2f61c07a7e..c76859b2b4c5 100644 --- a/firefox-ios/Client/Frontend/Settings/ThemeSettings/ThemeSettingsController.swift +++ b/firefox-ios/Client/Frontend/Settings/ThemeSettings/ThemeSettingsController.swift @@ -13,7 +13,6 @@ class ThemeSettingsController: ThemedTableViewController, StoreSubscriber { struct UX { static var rowHeight: CGFloat = 70 static var moonSunIconSize: CGFloat = 18 - static var footerFontSize: CGFloat = 12 static var sliderLeftRightInset: CGFloat = 16 static var spaceBetweenTableSections: CGFloat = 20 } @@ -202,8 +201,7 @@ class ThemeSettingsController: ThemedTableViewController, StoreSubscriber { let label: UILabel = .build { label in label.text = .DisplayThemeSectionFooter label.numberOfLines = 0 - label.font = DefaultDynamicFontHelper.preferredFont(withTextStyle: .footnote, - size: UX.footerFontSize) + label.font = FXFontStyles.Regular.caption1.scaledFont() label.textColor = self.themeManager.currentTheme(for: self.windowUUID).colors.textSecondary } footer.addSubview(label)