diff --git a/firefox-ios/Client/Frontend/Autofill/CreditCard/CreditCardSettingsView/CreditCardInputView.swift b/firefox-ios/Client/Frontend/Autofill/CreditCard/CreditCardSettingsView/CreditCardInputView.swift index d610a195da57d..1704036f2c333 100644 --- a/firefox-ios/Client/Frontend/Autofill/CreditCard/CreditCardSettingsView/CreditCardInputView.swift +++ b/firefox-ios/Client/Frontend/Autofill/CreditCard/CreditCardSettingsView/CreditCardInputView.swift @@ -8,7 +8,7 @@ import SwiftUI import struct MozillaAppServices.CreditCard -struct CreditCardInputView: View { +struct CreditCardInputView: ThemeableView { private struct UX { static let cornerRadius: CGFloat = 24 static let blurRadius: CGFloat = 10 @@ -24,25 +24,24 @@ struct CreditCardInputView: View { // Theming let windowUUID: WindowUUID - @Environment(\.themeManager) - var themeManager - @State var backgroundColor: Color = .clear - @State var borderColor: Color = .clear - @State var textFieldBackgroundColor: Color = .clear - @State var barButtonColor: Color = .clear - @State var saveButtonDisabledColor: Color = .clear + var themeManager: ThemeManager + @State var theme: Theme + + init( + viewModel: CreditCardInputViewModel, + windowUUID: WindowUUID, + themeManager: ThemeManager + ) { + self.viewModel = viewModel + self.windowUUID = windowUUID + self.themeManager = themeManager + self.theme = themeManager.getCurrentTheme(for: windowUUID) + } var body: some View { NavigationView { main .blur(radius: isBlurred ? UX.blurRadius : 0) - .onAppear { - applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID)) - } - .onReceive(NotificationCenter.default.publisher(for: .ThemeDidChange)) { notification in - guard let uuid = notification.windowUUID, uuid == windowUUID else { return } - applyTheme(theme: themeManager.getCurrentTheme(for: windowUUID)) - } .onReceive(NotificationCenter.default.publisher( for: UIApplication.willResignActiveNotification) ) { _ in @@ -54,11 +53,12 @@ struct CreditCardInputView: View { isBlurred = false } } + .listenToThemeChanges(theme: $theme, manager: themeManager, windowUUID: windowUUID) } private var main: some View { return ZStack { - backgroundColor.ignoresSafeArea() + Color(theme.colors.layer1).ignoresSafeArea() form .navigationBarTitle(viewModel.state.title, displayMode: .inline) @@ -66,15 +66,15 @@ struct CreditCardInputView: View { ToolbarItem(placement: .navigationBarTrailing) { rightBarButton() .disabled(!viewModel.isRightBarButtonEnabled) - .foregroundColor(barButtonColor) + .foregroundColor(Color(theme.colors.actionPrimary)) } ToolbarItem(placement: .navigationBarLeading) { leftBarButton() - .foregroundColor(barButtonColor) + .foregroundColor(Color(theme.colors.actionPrimary)) } } .padding(.top, 0) - .background(backgroundColor.edgesIgnoringSafeArea(.bottom)) + .background(Color(theme.colors.layer1).edgesIgnoringSafeArea(.bottom)) } } @@ -83,21 +83,21 @@ struct CreditCardInputView: View { if #unavailable(iOS 26.0) { Divider() .frame(height: UX.dividerHeight) - .foregroundColor(borderColor) + .foregroundColor(.clear) } name - .background(textFieldBackgroundColor) + .background(Color(theme.colors.layer2)) .modifier(NewStyleRoundedCorners(topLeadingCorner: UX.cornerRadius, topTrailingCorner: UX.cornerRadius, bottomLeadingCorner: nil, bottomTrailingCorner: nil)) number - .background(textFieldBackgroundColor) + .background(Color(theme.colors.layer2)) expiration - .background(textFieldBackgroundColor) + .background(Color(theme.colors.layer2)) .modifier(NewStyleRoundedCorners(topLeadingCorner: nil, topTrailingCorner: nil, bottomLeadingCorner: UX.cornerRadius, @@ -127,7 +127,7 @@ struct CreditCardInputView: View { Divider() .frame(height: UX.dividerHeight) - .foregroundColor(borderColor) + .foregroundColor(.clear) .padding(.top, UX.dividerPaddingTop) } } @@ -142,7 +142,7 @@ struct CreditCardInputView: View { Divider() .frame(height: UX.dividerHeight) - .foregroundColor(borderColor) + .foregroundColor(.clear) .padding(.top, UX.dividerPaddingTop) } } @@ -158,20 +158,12 @@ struct CreditCardInputView: View { if #unavailable(iOS 26.0) { Divider() .frame(height: UX.dividerHeight) - .foregroundColor(borderColor) + .foregroundColor(.clear) .padding(.top, UX.dividerPaddingTop) } } } - func applyTheme(theme: Theme) { - let color = theme.colors - backgroundColor = Color(color.layer1) - textFieldBackgroundColor = Color(color.layer2) - barButtonColor = Color(color.actionPrimary) - saveButtonDisabledColor = Color(color.textSecondary) - } - func rightBarButton() -> some View { let btnState = viewModel.state.rightBarBtn return Button(btnState.title) { @@ -210,7 +202,13 @@ struct CreditCardInputView: View { } } } - .foregroundColor(viewModel.isRightBarButtonEnabled ? barButtonColor : saveButtonDisabledColor) + .modifier( + CreditCardViewButtonStyle( + isEnabled: viewModel.isRightBarButtonEnabled, + theme: theme, + buttonState: btnState + ) + ) .onDisappear { viewModel.isRightBarButtonEnabled = false } @@ -250,6 +248,10 @@ struct CreditCardEditView_Previews: PreviewProvider { creditCard: sampleCreditCard, state: .view) - return CreditCardInputView(viewModel: viewModel, windowUUID: .XCTestDefaultUUID) + return CreditCardInputView( + viewModel: viewModel, + windowUUID: .XCTestDefaultUUID, + themeManager: DefaultThemeManager(sharedContainerIdentifier: "") + ) } } diff --git a/firefox-ios/Client/Frontend/Autofill/CreditCard/CreditCardSettingsView/CreditCardSettingsViewController.swift b/firefox-ios/Client/Frontend/Autofill/CreditCard/CreditCardSettingsView/CreditCardSettingsViewController.swift index fc06383b3350b..39adc0f30b032 100644 --- a/firefox-ios/Client/Frontend/Autofill/CreditCard/CreditCardSettingsView/CreditCardSettingsViewController.swift +++ b/firefox-ios/Client/Frontend/Autofill/CreditCard/CreditCardSettingsView/CreditCardSettingsViewController.swift @@ -163,7 +163,11 @@ class CreditCardSettingsViewController: SensitiveViewController, UIAdaptivePrese viewModel.cardInputViewModel.creditCard = creditCard } viewModel.cardInputViewModel.updateState(state: editState) - creditCardEditView = CreditCardInputView(viewModel: viewModel.cardInputViewModel, windowUUID: windowUUID) + creditCardEditView = CreditCardInputView( + viewModel: viewModel.cardInputViewModel, + windowUUID: windowUUID, + themeManager: themeManager + ) viewModel.cardInputViewModel.dismiss = { [weak self] status, successVal in DispatchQueue.main.async { if successVal { diff --git a/firefox-ios/Client/Frontend/Library/Bookmarks/BookmarksViewController.swift b/firefox-ios/Client/Frontend/Library/Bookmarks/BookmarksViewController.swift index 10ead7ac8ea31..e23032ac456e1 100644 --- a/firefox-ios/Client/Frontend/Library/Bookmarks/BookmarksViewController.swift +++ b/firefox-ios/Client/Frontend/Library/Bookmarks/BookmarksViewController.swift @@ -46,16 +46,28 @@ final class BookmarksViewController: SiteTableViewController, switch state { case .bookmarks(state: .mainView), .bookmarks(state: .inFolder): bottomRightButton.title = .BookmarksEdit + if #available(iOS 26.0, *) { + bottomRightButton.tintColor = currentTheme().colors.textPrimary + } return [flexibleSpace, bottomRightButton] case .bookmarks(state: .inFolderEditMode): bottomRightButton.title = String.AppSettingsDone + if #available(iOS 26.0, *) { + bottomRightButton.tintColor = currentTheme().colors.textAccent + } return [bottomLeftButton, flexibleSpace, bottomRightButton] case .bookmarks(state: .itemEditMode): bottomRightButton.title = String.AppSettingsDone + if #available(iOS 26.0, *) { + bottomRightButton.tintColor = currentTheme().colors.textAccent + } bottomRightButton.isEnabled = true return [flexibleSpace, bottomRightButton] case .bookmarks(state: .itemEditModeInvalidField): bottomRightButton.title = String.AppSettingsDone + if #available(iOS 26.0, *) { + bottomRightButton.tintColor = currentTheme().colors.textAccent + } bottomRightButton.isEnabled = false return [flexibleSpace, bottomRightButton] default: diff --git a/firefox-ios/Client/Frontend/Library/Bookmarks/Edit Bookmark/EditBookmarkViewController.swift b/firefox-ios/Client/Frontend/Library/Bookmarks/Edit Bookmark/EditBookmarkViewController.swift index 4ab468fab9d65..792d668ba4faa 100644 --- a/firefox-ios/Client/Frontend/Library/Bookmarks/Edit Bookmark/EditBookmarkViewController.swift +++ b/firefox-ios/Client/Frontend/Library/Bookmarks/Edit Bookmark/EditBookmarkViewController.swift @@ -46,7 +46,7 @@ class EditBookmarkViewController: UIViewController, private lazy var saveBarButton: UIBarButtonItem = { let button = UIBarButtonItem( title: String.Bookmarks.Menu.EditBookmarkSave, - style: .done, + style: .plain, target: self, action: #selector(saveButtonAction) ) @@ -180,6 +180,9 @@ class EditBookmarkViewController: UIViewController, navigationController?.navigationBar.tintColor = theme.colors.actionPrimary view.backgroundColor = theme.colors.layer1 tableView.backgroundColor = theme.colors.layer1 + if #available(iOS 26.0, *) { + saveBarButton.tintColor = theme.colors.textAccent + } } // MARK: - Configure Table View Cells diff --git a/firefox-ios/Client/Frontend/Library/Bookmarks/Edit Folder/EditFolderViewController.swift b/firefox-ios/Client/Frontend/Library/Bookmarks/Edit Folder/EditFolderViewController.swift index 8e8492208dba9..26c6f2184f2c9 100644 --- a/firefox-ios/Client/Frontend/Library/Bookmarks/Edit Folder/EditFolderViewController.swift +++ b/firefox-ios/Client/Frontend/Library/Bookmarks/Edit Folder/EditFolderViewController.swift @@ -53,7 +53,7 @@ class EditFolderViewController: UIViewController, private lazy var saveBarButton: UIBarButtonItem = { let button = UIBarButtonItem( title: String.Bookmarks.Menu.EditBookmarkSave, - style: .done, + style: .plain, target: self, action: #selector(saveButtonAction) ) @@ -158,6 +158,9 @@ class EditFolderViewController: UIViewController, navigationController?.navigationBar.tintColor = theme.colors.actionPrimary view.backgroundColor = theme.colors.layer1 tableView.backgroundColor = theme.colors.layer1 + if #available(iOS 26.0, *) { + saveBarButton.tintColor = theme.colors.textAccent + } } // MARK: - UITableViewDataSource & UITableViewDelegate diff --git a/firefox-ios/Client/Frontend/Library/LibraryViewController/LibraryViewController.swift b/firefox-ios/Client/Frontend/Library/LibraryViewController/LibraryViewController.swift index 5a2fc055489ef..6443487926034 100644 --- a/firefox-ios/Client/Frontend/Library/LibraryViewController/LibraryViewController.swift +++ b/firefox-ios/Client/Frontend/Library/LibraryViewController/LibraryViewController.swift @@ -59,7 +59,7 @@ class LibraryViewController: UIViewController, Themeable { private lazy var topRightButton: UIBarButtonItem = { let button = UIBarButtonItem( title: String.AppSettingsDone, - style: .done, + style: .plain, target: self, action: #selector(topRightButtonAction) ) @@ -301,14 +301,23 @@ class LibraryViewController: UIViewController, Themeable { navigationItem.rightBarButtonItem = nil case .bookmarks(state: .itemEditMode): topRightButton.title = .SettingsAddCustomEngineSaveButtonText + if #available(iOS 26.0, *) { + topRightButton.tintColor = currentTheme().colors.textAccent + } navigationItem.rightBarButtonItem = topRightButton navigationItem.rightBarButtonItem?.isEnabled = true case .bookmarks(state: .itemEditModeInvalidField): topRightButton.title = .SettingsAddCustomEngineSaveButtonText + if #available(iOS 26.0, *) { + topRightButton.tintColor = currentTheme().colors.textAccent + } navigationItem.rightBarButtonItem = topRightButton navigationItem.rightBarButtonItem?.isEnabled = false default: topRightButton.title = String.AppSettingsDone + if #available(iOS 26.0, *) { + topRightButton.tintColor = currentTheme().colors.textPrimary + } navigationItem.rightBarButtonItem = topRightButton navigationItem.rightBarButtonItem?.isEnabled = true } @@ -363,7 +372,7 @@ class LibraryViewController: UIViewController, Themeable { } private func setupToolBarAppearance() { - let theme = themeManager.getCurrentTheme(for: windowUUID) + let theme = currentTheme() let standardAppearance = UIToolbarAppearance() standardAppearance.configureWithDefaultBackground() standardAppearance.backgroundColor = theme.colors.layer1 @@ -392,6 +401,10 @@ class LibraryViewController: UIViewController, Themeable { } } + private func currentTheme() -> Theme { + return themeManager.getCurrentTheme(for: windowUUID) + } + func applyTheme() { // There is an ANNOYING bar in the nav bar above the segment control. These are the // UIBarBackgroundShadowViews. We must set them to be clear images in order to @@ -399,7 +412,7 @@ class LibraryViewController: UIViewController, Themeable { navigationController?.navigationBar.setBackgroundImage(UIImage(), for: .default) navigationController?.navigationBar.shadowImage = UIImage() - let theme = themeManager.getCurrentTheme(for: windowUUID) + let theme = currentTheme() view.backgroundColor = theme.colors.layer1 navigationController?.navigationBar.barTintColor = theme.colors.layer1 navigationController?.navigationBar.tintColor = theme.colors.actionPrimary diff --git a/firefox-ios/Client/Frontend/Onboarding/Protocols/OnboardingCardDelegate.swift b/firefox-ios/Client/Frontend/Onboarding/Protocols/OnboardingCardDelegate.swift index c18a84a6510d2..e865c81ace5fd 100644 --- a/firefox-ios/Client/Frontend/Onboarding/Protocols/OnboardingCardDelegate.swift +++ b/firefox-ios/Client/Frontend/Onboarding/Protocols/OnboardingCardDelegate.swift @@ -152,9 +152,12 @@ extension OnboardingCardDelegate where Self: OnboardingViewControllerProtocol, windowUUID: windowUUID) let buttonItem = UIBarButtonItem( title: .SettingsSearchDoneButton, - style: .done, + style: .plain, target: self, action: selector) + if #available(iOS 26.0, *) { + buttonItem.tintColor = themeManager.getCurrentTheme(for: windowUUID).colors.textPrimary + } singInSyncVC.navigationItem.rightBarButtonItem = buttonItem (singInSyncVC as? FirefoxAccountSignInViewController)?.qrCodeNavigationHandler = qrCodeNavigationHandler diff --git a/firefox-ios/Client/Frontend/Onboarding/Protocols/OnboardingService.swift b/firefox-ios/Client/Frontend/Onboarding/Protocols/OnboardingService.swift index a835b04f3dc5a..4739c91eb1eb2 100644 --- a/firefox-ios/Client/Frontend/Onboarding/Protocols/OnboardingService.swift +++ b/firefox-ios/Client/Frontend/Onboarding/Protocols/OnboardingService.swift @@ -290,7 +290,11 @@ final class OnboardingService: FeatureFlaggable { style: .plain, target: self, action: #selector(dismissSelector)) - buttonItem.tintColor = themeManager.getCurrentTheme(for: windowUUID).colors.actionPrimary + if #available(iOS 26.0, *) { + buttonItem.tintColor = themeManager.getCurrentTheme(for: windowUUID).colors.textPrimary + } else { + buttonItem.tintColor = themeManager.getCurrentTheme(for: windowUUID).colors.actionPrimary + } singInSyncVC.navigationItem.rightBarButtonItem = buttonItem (singInSyncVC as? FirefoxAccountSignInViewController)?.qrCodeNavigationHandler = qrCodeNavigationHandler diff --git a/firefox-ios/Client/Frontend/Onboarding/Views/PrivacyPolicyViewController.swift b/firefox-ios/Client/Frontend/Onboarding/Views/PrivacyPolicyViewController.swift index 6848932cb3235..50119cbb17224 100644 --- a/firefox-ios/Client/Frontend/Onboarding/Views/PrivacyPolicyViewController.swift +++ b/firefox-ios/Client/Frontend/Onboarding/Views/PrivacyPolicyViewController.swift @@ -64,7 +64,11 @@ class PrivacyPolicyViewController: UIViewController, Themeable { // MARK: - Theming func applyTheme() { let theme = themeManager.getCurrentTheme(for: windowUUID) - navigationItem.rightBarButtonItem?.tintColor = theme.colors.actionPrimary + if #available(iOS 26.0, *) { + navigationItem.rightBarButtonItem?.tintColor = theme.colors.textPrimary + } else { + navigationItem.rightBarButtonItem?.tintColor = theme.colors.actionPrimary + } } } diff --git a/firefox-ios/Client/Frontend/Onboarding/Views/PrivacyPreferencesViewController.swift b/firefox-ios/Client/Frontend/Onboarding/Views/PrivacyPreferencesViewController.swift index 11ed85ccb1e93..803640715b8ae 100644 --- a/firefox-ios/Client/Frontend/Onboarding/Views/PrivacyPreferencesViewController.swift +++ b/firefox-ios/Client/Frontend/Onboarding/Views/PrivacyPreferencesViewController.swift @@ -287,7 +287,11 @@ final class PrivacyPreferencesViewController: UIViewController, } titleLabel.textColor = theme.colors.textPrimary - doneButton.setTitleColor(theme.colors.textAccent, for: .normal) + if #available(iOS 26.0, *) { + doneButton.setTitleColor(theme.colors.textPrimary, for: .normal) + } else { + doneButton.setTitleColor(theme.colors.textAccent, for: .normal) + } crashReportsSwitch.applyTheme(theme: theme) technicalDataSwitch.applyTheme(theme: theme) setupContentViews() diff --git a/firefox-ios/Client/Frontend/PasswordManagement/AddCredentialViewController.swift b/firefox-ios/Client/Frontend/PasswordManagement/AddCredentialViewController.swift index 24381d98cdf41..f302215688da4 100644 --- a/firefox-ios/Client/Frontend/PasswordManagement/AddCredentialViewController.swift +++ b/firefox-ios/Client/Frontend/PasswordManagement/AddCredentialViewController.swift @@ -53,12 +53,16 @@ class AddCredentialViewController: UIViewController, Themeable { fileprivate lazy var saveButton: UIBarButtonItem = { let button = UIBarButtonItem( title: .SettingsAddCustomEngineSaveButtonText, - style: .done, + style: .plain, target: self, action: #selector(addCredential) ) button.isEnabled = false - button.tintColor = themeManager.getCurrentTheme(for: windowUUID).colors.actionPrimary + if #available(iOS 26.0, *) { + button.tintColor = themeManager.getCurrentTheme(for: windowUUID).colors.textAccent + } else { + button.tintColor = themeManager.getCurrentTheme(for: windowUUID).colors.actionPrimary + } return button }() diff --git a/firefox-ios/Client/Frontend/Settings/AppearanceSettings/StylingViewModifiers.swift b/firefox-ios/Client/Frontend/Settings/AppearanceSettings/StylingViewModifiers.swift index 2f21ceafe54e5..92e67264d4046 100644 --- a/firefox-ios/Client/Frontend/Settings/AppearanceSettings/StylingViewModifiers.swift +++ b/firefox-ios/Client/Frontend/Settings/AppearanceSettings/StylingViewModifiers.swift @@ -164,3 +164,36 @@ struct ToggleStyle: ViewModifier { } } } + +struct CreditCardViewButtonStyle: ViewModifier { + let isEnabled: Bool + let theme: Theme + let buttonState: CreditCardRightBarButton + + func body(content: Content) -> some View { + if #available(iOS 26.0, *) { + content.foregroundColor(getColorForiOS26()) + } else { + content.foregroundColor(getColorForLegacyiOS()) + } + } + + private func getColorForiOS26() -> Color { + if !isEnabled { + return Color(theme.colors.textSecondary) + } + + switch buttonState { + case .edit: + return Color(theme.colors.textPrimary) + default: + return Color(theme.colors.textAccent) + } + } + + private func getColorForLegacyiOS() -> Color { + return isEnabled + ? Color(theme.colors.actionPrimary) + : Color(theme.colors.textSecondary) + } +} diff --git a/firefox-ios/Client/Frontend/Settings/ContentBlockerSettingViewController.swift b/firefox-ios/Client/Frontend/Settings/ContentBlockerSettingViewController.swift index 3426df2717f84..f365ebbcf4603 100644 --- a/firefox-ios/Client/Frontend/Settings/ContentBlockerSettingViewController.swift +++ b/firefox-ios/Client/Frontend/Settings/ContentBlockerSettingViewController.swift @@ -36,6 +36,10 @@ class ContentBlockerSettingViewController: SettingsTableViewController, style: .plain, target: self, action: #selector(done)) + if #available(iOS 26.0, *) { + let theme = themeManager.getCurrentTheme(for: windowUUID) + navigationItem.rightBarButtonItem?.tintColor = theme.colors.textPrimary + } } } diff --git a/firefox-ios/Client/Frontend/Settings/CustomSearchViewController.swift b/firefox-ios/Client/Frontend/Settings/CustomSearchViewController.swift index 3444c768d29a4..5b1a80ad92929 100644 --- a/firefox-ios/Client/Frontend/Settings/CustomSearchViewController.swift +++ b/firefox-ios/Client/Frontend/Settings/CustomSearchViewController.swift @@ -209,6 +209,10 @@ class CustomSearchViewController: SettingsTableViewController { target: self, action: #selector(self.addCustomSearchEngine) ) + if #available(iOS 26.0, *) { + let theme = themeManager.getCurrentTheme(for: windowUUID) + self.navigationItem.rightBarButtonItem?.tintColor = theme.colors.textAccent + } self.navigationItem.rightBarButtonItem?.accessibilityIdentifier = "customEngineSaveButton" self.navigationItem.rightBarButtonItem?.isEnabled = false diff --git a/firefox-ios/Client/Frontend/Settings/HomepageSettings/HomePageSettingViewController.swift b/firefox-ios/Client/Frontend/Settings/HomepageSettings/HomePageSettingViewController.swift index 7ad18f9c554cb..ba8425d269908 100644 --- a/firefox-ios/Client/Frontend/Settings/HomepageSettings/HomePageSettingViewController.swift +++ b/firefox-ios/Client/Frontend/Settings/HomepageSettings/HomePageSettingViewController.swift @@ -43,6 +43,10 @@ class HomePageSettingViewController: SettingsTableViewController, FeatureFlaggab style: .plain, target: self, action: #selector(done)) + if #available(iOS 26.0, *) { + let theme = themeManager.getCurrentTheme(for: windowUUID) + navigationItem.rightBarButtonItem?.tintColor = theme.colors.textPrimary + } } required init?(coder aDecoder: NSCoder) { diff --git a/firefox-ios/Client/Frontend/Settings/Main/AppSettingsTableViewController.swift b/firefox-ios/Client/Frontend/Settings/Main/AppSettingsTableViewController.swift index 7a09bde90516a..e6199aa8bce97 100644 --- a/firefox-ios/Client/Frontend/Settings/Main/AppSettingsTableViewController.swift +++ b/firefox-ios/Client/Frontend/Settings/Main/AppSettingsTableViewController.swift @@ -146,9 +146,13 @@ class AppSettingsTableViewController: SettingsTableViewController, navigationItem.title = String.AppSettingsTitle navigationItem.rightBarButtonItem = UIBarButtonItem( title: .AppSettingsDone, - style: .done, + style: .plain, target: self, action: #selector(done)) + if #available(iOS 26.0, *) { + let theme = themeManager.getCurrentTheme(for: windowUUID) + navigationItem.rightBarButtonItem?.tintColor = theme.colors.textPrimary + } } // MARK: - Accessibility Identifiers diff --git a/firefox-ios/Client/Frontend/Settings/SearchSettingsTableViewController.swift b/firefox-ios/Client/Frontend/Settings/SearchSettingsTableViewController.swift index 045bf0bfc41cb..732f67cdc5764 100644 --- a/firefox-ios/Client/Frontend/Settings/SearchSettingsTableViewController.swift +++ b/firefox-ios/Client/Frontend/Settings/SearchSettingsTableViewController.swift @@ -152,10 +152,14 @@ final class SearchSettingsTableViewController: ThemedTableViewController, Featur if !(self.navigationController is ThemedNavigationController) { self.navigationItem.leftBarButtonItem = UIBarButtonItem( title: .SettingsSearchDoneButton, - style: .done, + style: .plain, target: self, action: #selector(self.dismissAnimated) ) + if #available(iOS 26.0, *) { + let textColor = themeManager.getCurrentTheme(for: windowUUID).colors.textPrimary + self.navigationItem.leftBarButtonItem?.tintColor = textColor + } } navigationItem.rightBarButtonItem = UIBarButtonItem( @@ -658,6 +662,9 @@ final class SearchSettingsTableViewController: ThemedTableViewController, Featur showDeletion = editing UIView.performWithoutAnimation { self.navigationItem.rightBarButtonItem?.title = editing ? .SettingsSearchDoneButton : .SettingsSearchEditButton + let theme = themeManager.getCurrentTheme(for: windowUUID) + let textColor = editing ? theme.colors.textAccent : theme.colors.textPrimary + self.navigationItem.rightBarButtonItem?.tintColor = textColor } navigationItem.rightBarButtonItem?.isEnabled = isEditable navigationItem.rightBarButtonItem?.action = editing ? diff --git a/firefox-ios/firefox-ios-tests/Tests/ClientTests/CreditCard/CreditCardSettingsViewControllerTests.swift b/firefox-ios/firefox-ios-tests/Tests/ClientTests/CreditCard/CreditCardSettingsViewControllerTests.swift index a580a3a17c549..217a547928d68 100644 --- a/firefox-ios/firefox-ios-tests/Tests/ClientTests/CreditCard/CreditCardSettingsViewControllerTests.swift +++ b/firefox-ios/firefox-ios-tests/Tests/ClientTests/CreditCard/CreditCardSettingsViewControllerTests.swift @@ -25,12 +25,17 @@ final class CreditCardSettingsViewControllerTests: XCTestCase { viewModel = nil } + @MainActor func testInputViewFormValuesClearedOnDismiss() { let subject = createSubject() subject.viewModel.cardInputViewModel.nameOnCard = "Ashton Mealy" subject.viewModel.cardInputViewModel.cardNumber = "4268811063712243" subject.viewModel.cardInputViewModel.expirationDate = "1288" - let creditCardInputView = CreditCardInputView(viewModel: viewModel, windowUUID: WindowUUID.XCTestDefaultUUID) + let creditCardInputView = CreditCardInputView( + viewModel: viewModel, + windowUUID: WindowUUID.XCTestDefaultUUID, + themeManager: MockThemeManager() + ) let hostingController = UIHostingController(rootView: creditCardInputView) subject.present(hostingController, animated: true) let presentationController = UIPresentationController(