From d22a59e47ec9a9839fbb0d0736aeafec7f21b2c5 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Mon, 25 Jul 2022 19:19:46 +0100 Subject: [PATCH 01/35] Update editor's tint colour to always be WP Blue The editor's "tintColor" is explicitly set to be "wordPressBlue" with this commit. The most notable colour that will change following this is the editor's cursor and "highlight" colour when text is selected. --- .../Classes/ViewRelated/Gutenberg/GutenbergViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index 489348ca2754..22e35b740655 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -554,6 +554,7 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega extension GutenbergViewController { private func setupGutenbergView() { view.backgroundColor = .white + view.tintColor = WPStyleGuide.wordPressBlue() gutenberg.rootView.translatesAutoresizingMaskIntoConstraints = false gutenberg.rootView.backgroundColor = .basicBackground view.addSubview(gutenberg.rootView) From 0948e1e825fb9dd0f3757c1279d43b8626ab9341 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Mon, 25 Jul 2022 22:22:11 +0100 Subject: [PATCH 02/35] Update tintColor to match correct shade of blue --- .../Classes/ViewRelated/Gutenberg/GutenbergViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index 22e35b740655..589797310888 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -554,7 +554,7 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega extension GutenbergViewController { private func setupGutenbergView() { view.backgroundColor = .white - view.tintColor = WPStyleGuide.wordPressBlue() + view.tintColor = UIColor.muriel(color: MurielColor(name: .blue)) gutenberg.rootView.translatesAutoresizingMaskIntoConstraints = false gutenberg.rootView.backgroundColor = .basicBackground view.addSubview(gutenberg.rootView) From 5ee8d0c92415d05959f328b2f9d4eb5a7e0becfb Mon Sep 17 00:00:00 2001 From: Siobhan Date: Mon, 25 Jul 2022 22:28:27 +0100 Subject: [PATCH 03/35] Update RELEASE-NOTES --- RELEASE-NOTES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index 7d32d670d0cb..97f652641c91 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -1,5 +1,6 @@ 20.5 ----- +* [*] [Jetpack-only] Block Editor: Makes some small changes to the cursor and highlight colours for consistency. [#19113] 20.4 From 38aac84dfa9d20d79012a0a6bcc23a56f1a587d7 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Tue, 26 Jul 2022 16:27:04 +0100 Subject: [PATCH 04/35] Set tintColor for *entire* editor window --- .../ViewRelated/Gutenberg/GutenbergViewController.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index 589797310888..818ce296f5b1 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -554,13 +554,17 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega extension GutenbergViewController { private func setupGutenbergView() { view.backgroundColor = .white - view.tintColor = UIColor.muriel(color: MurielColor(name: .blue)) gutenberg.rootView.translatesAutoresizingMaskIntoConstraints = false gutenberg.rootView.backgroundColor = .basicBackground view.addSubview(gutenberg.rootView) view.pinSubviewToAllEdges(gutenberg.rootView) gutenberg.rootView.pinSubviewToAllEdges(ghostView) + + // Explicitly set the tintColor in the editor's window to blue. + let appDelegate = UIApplication.shared.delegate + let window = appDelegate?.window + window??.tintColor = UIColor.muriel(color: MurielColor(name: .blue)) } } From feb03eae270bc566063f648a9664482045b05eda Mon Sep 17 00:00:00 2001 From: Siobhan Date: Tue, 26 Jul 2022 16:30:28 +0100 Subject: [PATCH 05/35] Clarify purpose of code in comment --- .../Classes/ViewRelated/Gutenberg/GutenbergViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index 818ce296f5b1..14e8aa22321c 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -561,7 +561,7 @@ extension GutenbergViewController { view.pinSubviewToAllEdges(gutenberg.rootView) gutenberg.rootView.pinSubviewToAllEdges(ghostView) - // Explicitly set the tintColor in the editor's window to blue. + // Explicitly set the tintColor in the editor's window to blue, to avoid unexpected overrides. let appDelegate = UIApplication.shared.delegate let window = appDelegate?.window window??.tintColor = UIColor.muriel(color: MurielColor(name: .blue)) From c85beaf61c7d255f604471cb1047af72b815fdbc Mon Sep 17 00:00:00 2001 From: Siobhan Date: Tue, 26 Jul 2022 16:49:36 +0100 Subject: [PATCH 06/35] Tidy up code for clarity and conciseness --- .../ViewRelated/Gutenberg/GutenbergViewController.swift | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index 14e8aa22321c..03a611dfdd7e 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -561,9 +561,8 @@ extension GutenbergViewController { view.pinSubviewToAllEdges(gutenberg.rootView) gutenberg.rootView.pinSubviewToAllEdges(ghostView) - // Explicitly set the tintColor in the editor's window to blue, to avoid unexpected overrides. - let appDelegate = UIApplication.shared.delegate - let window = appDelegate?.window + // Explicitly set the tintColor in the editor's window to blue in order to avoid unexpected overrides. + let window = UIApplication.shared.delegate?.window window??.tintColor = UIColor.muriel(color: MurielColor(name: .blue)) } } From 256a4d234ab800e17d318b2350a4f4c056370e73 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Wed, 27 Jul 2022 20:44:26 +0100 Subject: [PATCH 07/35] Revert previous changes Setting the tintColor to the entire window caused colours to be set elsewhere in the app. As such, this commit, reverts that change and limits the tintColor to the editor's root view. --- .../ViewRelated/Gutenberg/GutenbergViewController.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index 403d179e7e75..aa837f84963a 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -554,16 +554,13 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega extension GutenbergViewController { private func setupGutenbergView() { view.backgroundColor = .white + view.tintColor = UIColor.muriel(color: MurielColor(name: .blue)) gutenberg.rootView.translatesAutoresizingMaskIntoConstraints = false gutenberg.rootView.backgroundColor = .basicBackground view.addSubview(gutenberg.rootView) view.pinSubviewToAllEdges(gutenberg.rootView) gutenberg.rootView.pinSubviewToAllEdges(ghostView) - - // Explicitly set the tintColor in the editor's window to blue in order to avoid unexpected overrides. - let window = UIApplication.shared.delegate?.window - window??.tintColor = UIColor.muriel(color: MurielColor(name: .blue)) } } From 9e64f2b2fef1cf97612cfea69a2635020b1cef32 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Wed, 27 Jul 2022 20:45:23 +0100 Subject: [PATCH 08/35] Set tintColor for modals --- .../ViewRelated/Gutenberg/GutenbergViewController.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index aa837f84963a..15519ce21694 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -408,6 +408,11 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega } } + override func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) { + super.present(viewControllerToPresent, animated: flag, completion: completion) + presentedViewController?.view.tintColor = UIColor.muriel(color: MurielColor(name: .blue)) + } + // MARK: - Functions private var keyboardShowObserver: Any? From 4fa4d0cc0e060c28b61a5bbf66b0c01f2e9410fc Mon Sep 17 00:00:00 2001 From: Siobhan Date: Wed, 27 Jul 2022 23:18:50 +0100 Subject: [PATCH 09/35] Set tintColor to Post Settings screen --- WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m | 1 + 1 file changed, 1 insertion(+) diff --git a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m index b91e87ebb3c4..bd8578cc94fb 100644 --- a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m +++ b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m @@ -147,6 +147,7 @@ - (void)viewDidLoad self.tableView.accessibilityIdentifier = @"SettingsTable"; self.isUploadingMedia = NO; + self.tableView.tintColor = [UIColor blueColor]; NSManagedObjectContext *mainContext = [[ContextManager sharedInstance] mainContext]; _blogService = [[BlogService alloc] initWithManagedObjectContext:mainContext]; From a1cce5210b55b7598b062315a161d896520e267d Mon Sep 17 00:00:00 2001 From: Siobhan Date: Thu, 28 Jul 2022 12:11:18 +0100 Subject: [PATCH 10/35] Set tintColor for last Post Setting UI elements --- WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m | 2 ++ 1 file changed, 2 insertions(+) diff --git a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m index bd8578cc94fb..4233b3e2c709 100644 --- a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m +++ b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m @@ -167,6 +167,7 @@ - (void)viewWillAppear:(BOOL)animated [self.navigationController setNavigationBarHidden:NO animated:NO]; [self.navigationController setToolbarHidden:YES]; + self.navigationController.view.tintColor = [UIColor blueColor]; [self configureMetaSectionRows]; [self reloadData]; @@ -749,6 +750,7 @@ - (UITableViewCell *)configureStickyPostCellForIndexPath:(NSIndexPath *)indexPat [WPAnalytics trackEvent:WPAnalyticsEventEditorPostStickyChanged properties:@{@"via": @"settings"}]; weakSelf.post.isStickyPost = newValue; }; + cell.flipSwitch.onTintColor = [UIColor blueColor]; return cell; } From 324fe7be9b6c96e6a7e9b1e17475fd4684a84989 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Thu, 28 Jul 2022 12:54:15 +0100 Subject: [PATCH 11/35] Add editorPrimary var for clarity and reusability --- .../Classes/Extensions/Colors and Styles/MurielColor.swift | 1 + .../Extensions/Colors and Styles/UIColor+MurielColors.swift | 6 ++++++ .../Colors and Styles/UIColor+MurielColorsObjC.swift | 5 +++++ .../Classes/Utility/App Configuration/AppStyleGuide.swift | 1 + .../ViewRelated/Gutenberg/GutenbergViewController.swift | 4 ++-- .../Classes/ViewRelated/Post/PostSettingsViewController.m | 6 +++--- WordPress/Jetpack/AppStyleGuide.swift | 1 + 7 files changed, 19 insertions(+), 5 deletions(-) diff --git a/WordPress/Classes/Extensions/Colors and Styles/MurielColor.swift b/WordPress/Classes/Extensions/Colors and Styles/MurielColor.swift index 5a511979fc52..9ec538d8ea10 100644 --- a/WordPress/Classes/Extensions/Colors and Styles/MurielColor.swift +++ b/WordPress/Classes/Extensions/Colors and Styles/MurielColor.swift @@ -69,6 +69,7 @@ struct MurielColor { static let textSubtle = AppStyleGuide.textSubtle static let warning = AppStyleGuide.warning static let jetpackGreen = AppStyleGuide.jetpackGreen + static let editorPrimary = AppStyleGuide.editorPrimary /// The full name of the color, with required shade value func assetName() -> String { diff --git a/WordPress/Classes/Extensions/Colors and Styles/UIColor+MurielColors.swift b/WordPress/Classes/Extensions/Colors and Styles/UIColor+MurielColors.swift index 2ebb0133dfc0..86f1c65aa61d 100644 --- a/WordPress/Classes/Extensions/Colors and Styles/UIColor+MurielColors.swift +++ b/WordPress/Classes/Extensions/Colors and Styles/UIColor+MurielColors.swift @@ -62,6 +62,12 @@ extension UIColor { return muriel(color: .primary, shade) } + /// Muriel editor primary color + static var editorPrimary = muriel(color: .editorPrimary) + static var editorPrimaryLight = muriel(color: .editorPrimary, .shade30) + return muriel(color: .editorPrimary, shade) + } + /// Muriel success color static var success = muriel(color: .success) class func success(_ shade: MurielColorShade) -> UIColor { diff --git a/WordPress/Classes/Extensions/Colors and Styles/UIColor+MurielColorsObjC.swift b/WordPress/Classes/Extensions/Colors and Styles/UIColor+MurielColorsObjC.swift index 30d7221d5ab6..770acee2a39b 100644 --- a/WordPress/Classes/Extensions/Colors and Styles/UIColor+MurielColorsObjC.swift +++ b/WordPress/Classes/Extensions/Colors and Styles/UIColor+MurielColorsObjC.swift @@ -16,6 +16,11 @@ return .primaryDark } + @available(swift, obsoleted: 1.0) + static func murielEditorPrimary() -> UIColor { + return .editorPrimary + } + @available(swift, obsoleted: 1.0) static func murielNeutral() -> UIColor { return .neutral diff --git a/WordPress/Classes/Utility/App Configuration/AppStyleGuide.swift b/WordPress/Classes/Utility/App Configuration/AppStyleGuide.swift index 3b86c4035bd7..b871c7ef8f87 100644 --- a/WordPress/Classes/Utility/App Configuration/AppStyleGuide.swift +++ b/WordPress/Classes/Utility/App Configuration/AppStyleGuide.swift @@ -21,6 +21,7 @@ extension AppStyleGuide { static let textSubtle = MurielColor(name: .gray, shade: .shade50) static let warning = MurielColor(name: .yellow) static let jetpackGreen = MurielColor(name: .jetpackGreen) + static let editorPrimary = MurielColor(name: .blue) } // MARK: - Images diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index 15519ce21694..697ccf5cb0e7 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -410,7 +410,7 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega override func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) { super.present(viewControllerToPresent, animated: flag, completion: completion) - presentedViewController?.view.tintColor = UIColor.muriel(color: MurielColor(name: .blue)) + presentedViewController?.view.tintColor = UIColor.editorPrimary } // MARK: - Functions @@ -559,7 +559,7 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega extension GutenbergViewController { private func setupGutenbergView() { view.backgroundColor = .white - view.tintColor = UIColor.muriel(color: MurielColor(name: .blue)) + view.tintColor = UIColor.editorPrimary gutenberg.rootView.translatesAutoresizingMaskIntoConstraints = false gutenberg.rootView.backgroundColor = .basicBackground view.addSubview(gutenberg.rootView) diff --git a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m index 4233b3e2c709..dc461b761da4 100644 --- a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m +++ b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m @@ -147,7 +147,7 @@ - (void)viewDidLoad self.tableView.accessibilityIdentifier = @"SettingsTable"; self.isUploadingMedia = NO; - self.tableView.tintColor = [UIColor blueColor]; + self.tableView.tintColor = [UIColor murielEditorPrimary]; NSManagedObjectContext *mainContext = [[ContextManager sharedInstance] mainContext]; _blogService = [[BlogService alloc] initWithManagedObjectContext:mainContext]; @@ -167,7 +167,7 @@ - (void)viewWillAppear:(BOOL)animated [self.navigationController setNavigationBarHidden:NO animated:NO]; [self.navigationController setToolbarHidden:YES]; - self.navigationController.view.tintColor = [UIColor blueColor]; + self.navigationController.view.tintColor = [UIColor murielEditorPrimary]; [self configureMetaSectionRows]; [self reloadData]; @@ -750,7 +750,7 @@ - (UITableViewCell *)configureStickyPostCellForIndexPath:(NSIndexPath *)indexPat [WPAnalytics trackEvent:WPAnalyticsEventEditorPostStickyChanged properties:@{@"via": @"settings"}]; weakSelf.post.isStickyPost = newValue; }; - cell.flipSwitch.onTintColor = [UIColor blueColor]; + cell.flipSwitch.onTintColor = [UIColor murielEditorPrimary]; return cell; } diff --git a/WordPress/Jetpack/AppStyleGuide.swift b/WordPress/Jetpack/AppStyleGuide.swift index 66299119d67e..3400fea4b318 100644 --- a/WordPress/Jetpack/AppStyleGuide.swift +++ b/WordPress/Jetpack/AppStyleGuide.swift @@ -22,6 +22,7 @@ extension AppStyleGuide { static let textSubtle = MurielColor(name: .gray, shade: .shade50) static let warning = MurielColor(name: .yellow) static let jetpackGreen = MurielColor(name: .jetpackGreen) + static let editorPrimary = MurielColor(name: .blue) } // MARK: - Images From f4eb42691f95389b0452e58eec0f30ad0e51c62e Mon Sep 17 00:00:00 2001 From: Siobhan Date: Thu, 28 Jul 2022 12:56:17 +0100 Subject: [PATCH 12/35] Address mistake in previous commit In the previous commit, I accidentally committed the reference to "editorPrimaryLight", but hadn't intended to. This commit removes that reference and adds back the "editorPrimary" function that was accidentally deleted. --- .../Extensions/Colors and Styles/UIColor+MurielColors.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPress/Classes/Extensions/Colors and Styles/UIColor+MurielColors.swift b/WordPress/Classes/Extensions/Colors and Styles/UIColor+MurielColors.swift index 86f1c65aa61d..7bb3e8e13921 100644 --- a/WordPress/Classes/Extensions/Colors and Styles/UIColor+MurielColors.swift +++ b/WordPress/Classes/Extensions/Colors and Styles/UIColor+MurielColors.swift @@ -64,7 +64,7 @@ extension UIColor { /// Muriel editor primary color static var editorPrimary = muriel(color: .editorPrimary) - static var editorPrimaryLight = muriel(color: .editorPrimary, .shade30) + class func editorPrimary(_ shade: MurielColorShade) -> UIColor { return muriel(color: .editorPrimary, shade) } From b6b76c5f608ab1dd7fcd87895d0da19577890366 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Thu, 28 Jul 2022 15:14:22 +0100 Subject: [PATCH 13/35] Set tintColor on Post Settings' date picker --- .../Post/Scheduling/SchedulingDatePickerViewController.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/WordPress/Classes/ViewRelated/Post/Scheduling/SchedulingDatePickerViewController.swift b/WordPress/Classes/ViewRelated/Post/Scheduling/SchedulingDatePickerViewController.swift index 6d75a153ed8d..b72828534173 100644 --- a/WordPress/Classes/ViewRelated/Post/Scheduling/SchedulingDatePickerViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/Scheduling/SchedulingDatePickerViewController.swift @@ -211,5 +211,7 @@ extension DatePickerSheet where Self: UIViewController { view.addSubview(stackView) view.pinSubviewToSafeArea(stackView) + + view.tintColor = UIColor.editorPrimary } } From 4763d9c0ca69c2df63aa5e2b2b82e4928c8a23ba Mon Sep 17 00:00:00 2001 From: Siobhan Date: Thu, 28 Jul 2022 15:28:22 +0100 Subject: [PATCH 14/35] Small tweaks to code positioning, for readability --- .../Classes/ViewRelated/Post/PostSettingsViewController.m | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m index dc461b761da4..46da86204a51 100644 --- a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m +++ b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m @@ -141,13 +141,13 @@ - (void)viewDidLoad self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 0.0, 44.0)]; // add some vertical padding self.tableView.cellLayoutMarginsFollowReadableWidth = YES; + self.tableView.tintColor = [UIColor murielEditorPrimary]; // Compensate for the first section's height of 1.0f self.tableView.contentInset = UIEdgeInsetsMake(-1.0f, 0, 0, 0); self.tableView.accessibilityIdentifier = @"SettingsTable"; self.isUploadingMedia = NO; - self.tableView.tintColor = [UIColor murielEditorPrimary]; NSManagedObjectContext *mainContext = [[ContextManager sharedInstance] mainContext]; _blogService = [[BlogService alloc] initWithManagedObjectContext:mainContext]; @@ -167,6 +167,7 @@ - (void)viewWillAppear:(BOOL)animated [self.navigationController setNavigationBarHidden:NO animated:NO]; [self.navigationController setToolbarHidden:YES]; + self.navigationController.view.tintColor = [UIColor murielEditorPrimary]; [self configureMetaSectionRows]; From 57d86ea211b01581158777cd5cf15454efd92d60 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Thu, 28 Jul 2022 20:06:08 +0100 Subject: [PATCH 15/35] Set tintColor for switches in modals --- .../Classes/ViewRelated/Gutenberg/GutenbergViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index 697ccf5cb0e7..c5df211e8e90 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -411,6 +411,7 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega override func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) { super.present(viewControllerToPresent, animated: flag, completion: completion) presentedViewController?.view.tintColor = UIColor.editorPrimary + UISwitch.appearance().onTintColor = UIColor.editorPrimary } // MARK: - Functions From 7728b5a8376d7578d265f568f78fb177a03728f1 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Thu, 28 Jul 2022 20:49:57 +0100 Subject: [PATCH 16/35] Set tintColor for actionSheet in preseented modal This commit also refines the code for readability. --- .../Gutenberg/GutenbergViewController.swift | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index c5df211e8e90..c995e5857246 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -410,8 +410,14 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega override func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) { super.present(viewControllerToPresent, animated: flag, completion: completion) - presentedViewController?.view.tintColor = UIColor.editorPrimary - UISwitch.appearance().onTintColor = UIColor.editorPrimary + + let presentedView = presentedViewController?.view + let presentedViewSwitch = UISwitch.appearance() + let presentedViewActionSheet = UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]) + + presentedView?.tintColor = UIColor.editorPrimary + presentedViewSwitch.onTintColor = UIColor.editorPrimary + presentedViewActionSheet.tintColor = UIColor.editorPrimary } // MARK: - Functions From a4080b14daed2826da47fdbb34c77f10bb75b2cb Mon Sep 17 00:00:00 2001 From: Siobhan Date: Tue, 2 Aug 2022 11:50:48 +0100 Subject: [PATCH 17/35] Replace Post Settings' tintColor calls With this commit, some of the tintColor calls for UI elements in Post Settings have been moved to 'WordPressAppDelegate.swift'. This is in a bid to help with overall code readability/quality. --- WordPress/Classes/System/WordPressAppDelegate.swift | 11 +++++++++++ .../ViewRelated/Post/PostSettingsViewController.m | 2 -- .../SchedulingDatePickerViewController.swift | 1 - 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/WordPress/Classes/System/WordPressAppDelegate.swift b/WordPress/Classes/System/WordPressAppDelegate.swift index 99700952275e..1923f428d513 100644 --- a/WordPress/Classes/System/WordPressAppDelegate.swift +++ b/WordPress/Classes/System/WordPressAppDelegate.swift @@ -881,6 +881,17 @@ extension WordPressAppDelegate { UIButton.appearance(whenContainedInInstancesOf: [WPActionBar.self]).tintColor = .primary WPActionBar.appearance().barBackgroundColor = .basicBackground WPActionBar.appearance().lineColor = .basicBackground + + // Editor styles + + /// Post Settings + UITableView.appearance(whenContainedInInstancesOf: [PostSettingsViewController.self]).tintColor = .editorPrimary + UISwitch.appearance(whenContainedInInstancesOf: [PostSettingsViewController.self]).onTintColor = .editorPrimary + + if #available(iOS 14.0, *) { + let editorSettingsDatePicker = UIView.appearance(whenContainedInInstancesOf: [SchedulingDatePickerViewController.self]) + editorSettingsDatePicker.tintColor = .editorPrimary + } } } diff --git a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m index 46da86204a51..5bbd15fc307d 100644 --- a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m +++ b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m @@ -141,7 +141,6 @@ - (void)viewDidLoad self.tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 0.0, 44.0)]; // add some vertical padding self.tableView.cellLayoutMarginsFollowReadableWidth = YES; - self.tableView.tintColor = [UIColor murielEditorPrimary]; // Compensate for the first section's height of 1.0f self.tableView.contentInset = UIEdgeInsetsMake(-1.0f, 0, 0, 0); @@ -751,7 +750,6 @@ - (UITableViewCell *)configureStickyPostCellForIndexPath:(NSIndexPath *)indexPat [WPAnalytics trackEvent:WPAnalyticsEventEditorPostStickyChanged properties:@{@"via": @"settings"}]; weakSelf.post.isStickyPost = newValue; }; - cell.flipSwitch.onTintColor = [UIColor murielEditorPrimary]; return cell; } diff --git a/WordPress/Classes/ViewRelated/Post/Scheduling/SchedulingDatePickerViewController.swift b/WordPress/Classes/ViewRelated/Post/Scheduling/SchedulingDatePickerViewController.swift index b72828534173..7e55fc4562b8 100644 --- a/WordPress/Classes/ViewRelated/Post/Scheduling/SchedulingDatePickerViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/Scheduling/SchedulingDatePickerViewController.swift @@ -212,6 +212,5 @@ extension DatePickerSheet where Self: UIViewController { view.pinSubviewToSafeArea(stackView) - view.tintColor = UIColor.editorPrimary } } From 15effd5929d66996f1338becb0410f16cf082001 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Tue, 2 Aug 2022 14:15:32 +0100 Subject: [PATCH 18/35] Scope tintColor changes to editor This commit, specifically, scopes the changes to switches and action sheets (accessible via the editor's block settings) to only the editor. This addresses a previous bug in which the changes were applied throughout the app. --- .../Gutenberg/GutenbergViewController.swift | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index c995e5857246..02c23cc8f825 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -385,6 +385,7 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) + UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = .primary } override func viewLayoutMarginsDidChange() { @@ -412,12 +413,7 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega super.present(viewControllerToPresent, animated: flag, completion: completion) let presentedView = presentedViewController?.view - let presentedViewSwitch = UISwitch.appearance() - let presentedViewActionSheet = UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]) - - presentedView?.tintColor = UIColor.editorPrimary - presentedViewSwitch.onTintColor = UIColor.editorPrimary - presentedViewActionSheet.tintColor = UIColor.editorPrimary + presentedView?.tintColor = .editorPrimary } // MARK: - Functions @@ -573,6 +569,9 @@ extension GutenbergViewController { view.pinSubviewToAllEdges(gutenberg.rootView) gutenberg.rootView.pinSubviewToAllEdges(ghostView) + + UISwitch.appearance(whenContainedInInstancesOf: [RCTModalHostViewController.self]).onTintColor = .editorPrimary + UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = .editorPrimary } } From 7fe62670d61a64024ed4f9cd41965e063317df7f Mon Sep 17 00:00:00 2001 From: Siobhan Date: Tue, 2 Aug 2022 14:15:56 +0100 Subject: [PATCH 19/35] Small tweak: Remove unecessary reference --- .../Classes/ViewRelated/Gutenberg/GutenbergViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index 02c23cc8f825..722fc23781e0 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -562,7 +562,7 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega extension GutenbergViewController { private func setupGutenbergView() { view.backgroundColor = .white - view.tintColor = UIColor.editorPrimary + view.tintColor = .editorPrimary gutenberg.rootView.translatesAutoresizingMaskIntoConstraints = false gutenberg.rootView.backgroundColor = .basicBackground view.addSubview(gutenberg.rootView) From a8fb6ab7d608674faff0a051817cc5016959c370 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Tue, 2 Aug 2022 14:32:18 +0100 Subject: [PATCH 20/35] Refactor references to Post Settings UI Previously, the tintColor for certain UI elements within Post Settings were targeted directly from PostSettingsViewController.m. However, it's possible to target them directly from WordPressAppDelegate.swift, along with the screen's other UI elements. This commit goes ahead to refactor these references to help with code readability/reusability. --- WordPress/Classes/System/WordPressAppDelegate.swift | 1 + WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/WordPress/Classes/System/WordPressAppDelegate.swift b/WordPress/Classes/System/WordPressAppDelegate.swift index 1923f428d513..3c49f10eb600 100644 --- a/WordPress/Classes/System/WordPressAppDelegate.swift +++ b/WordPress/Classes/System/WordPressAppDelegate.swift @@ -887,6 +887,7 @@ extension WordPressAppDelegate { /// Post Settings UITableView.appearance(whenContainedInInstancesOf: [PostSettingsViewController.self]).tintColor = .editorPrimary UISwitch.appearance(whenContainedInInstancesOf: [PostSettingsViewController.self]).onTintColor = .editorPrimary + UIView.appearance(whenContainedInInstancesOf: [AztecNavigationController.self]).tintColor = .editorPrimary if #available(iOS 14.0, *) { let editorSettingsDatePicker = UIView.appearance(whenContainedInInstancesOf: [SchedulingDatePickerViewController.self]) diff --git a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m index 5bbd15fc307d..b91e87ebb3c4 100644 --- a/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m +++ b/WordPress/Classes/ViewRelated/Post/PostSettingsViewController.m @@ -167,8 +167,6 @@ - (void)viewWillAppear:(BOOL)animated [self.navigationController setNavigationBarHidden:NO animated:NO]; [self.navigationController setToolbarHidden:YES]; - self.navigationController.view.tintColor = [UIColor murielEditorPrimary]; - [self configureMetaSectionRows]; [self reloadData]; } From 85446856d1a97e8af89a7f507fdecaa254ef96f5 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Tue, 2 Aug 2022 14:33:24 +0100 Subject: [PATCH 21/35] Remove accidental whitespace --- .../Post/Scheduling/SchedulingDatePickerViewController.swift | 1 - 1 file changed, 1 deletion(-) diff --git a/WordPress/Classes/ViewRelated/Post/Scheduling/SchedulingDatePickerViewController.swift b/WordPress/Classes/ViewRelated/Post/Scheduling/SchedulingDatePickerViewController.swift index 7e55fc4562b8..6d75a153ed8d 100644 --- a/WordPress/Classes/ViewRelated/Post/Scheduling/SchedulingDatePickerViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/Scheduling/SchedulingDatePickerViewController.swift @@ -211,6 +211,5 @@ extension DatePickerSheet where Self: UIViewController { view.addSubview(stackView) view.pinSubviewToSafeArea(stackView) - } } From 67ceaa03611e747fdd7ab6e6cad86f63ebe2a738 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Tue, 2 Aug 2022 15:18:52 +0100 Subject: [PATCH 22/35] Set action sheet tintColor when editor appears --- .../Classes/ViewRelated/Gutenberg/GutenbergViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index 722fc23781e0..7a373eecaa84 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -374,6 +374,7 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega super.viewWillAppear(animated) verificationPromptHelper?.updateVerificationStatus() ghostView.startAnimation() + UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = .editorPrimary } override func viewDidAppear(_ animated: Bool) { @@ -571,7 +572,6 @@ extension GutenbergViewController { gutenberg.rootView.pinSubviewToAllEdges(ghostView) UISwitch.appearance(whenContainedInInstancesOf: [RCTModalHostViewController.self]).onTintColor = .editorPrimary - UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = .editorPrimary } } From d5a655bf7a9460376354fb961c269cb9cc1b1be3 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Tue, 2 Aug 2022 15:24:28 +0100 Subject: [PATCH 23/35] Update tintColor in Post Setting category screen --- WordPress/Classes/System/WordPressAppDelegate.swift | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/WordPress/Classes/System/WordPressAppDelegate.swift b/WordPress/Classes/System/WordPressAppDelegate.swift index 3c49f10eb600..88d6fd875654 100644 --- a/WordPress/Classes/System/WordPressAppDelegate.swift +++ b/WordPress/Classes/System/WordPressAppDelegate.swift @@ -893,6 +893,14 @@ extension WordPressAppDelegate { let editorSettingsDatePicker = UIView.appearance(whenContainedInInstancesOf: [SchedulingDatePickerViewController.self]) editorSettingsDatePicker.tintColor = .editorPrimary } + + /// Post Setting Categories + UIView.appearance(whenContainedInInstancesOf: [WPAddPostCategoryViewController.self]).tintColor = .editorPrimary + + UIView.appearance(whenContainedInInstancesOf: [PostCategoriesViewController.self, UINavigationController.self]).tintColor = .editorPrimary + + UIView.appearance(whenContainedInInstancesOf: [PostCategoriesViewController.self, UINavigationController.self, WPSplitViewController.self]).tintColor = .primary + } } From 0e3821d31433095b9cbd0801fa05ec27e53f4c32 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Tue, 2 Aug 2022 15:26:02 +0100 Subject: [PATCH 24/35] Update tintColor used in Post Settings media pick --- WordPress/Classes/System/WordPressAppDelegate.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/WordPress/Classes/System/WordPressAppDelegate.swift b/WordPress/Classes/System/WordPressAppDelegate.swift index 88d6fd875654..a9d2ab56056b 100644 --- a/WordPress/Classes/System/WordPressAppDelegate.swift +++ b/WordPress/Classes/System/WordPressAppDelegate.swift @@ -901,6 +901,11 @@ extension WordPressAppDelegate { UIView.appearance(whenContainedInInstancesOf: [PostCategoriesViewController.self, UINavigationController.self, WPSplitViewController.self]).tintColor = .primary + /// Featured Image Search. + UIView.appearance(whenContainedInInstancesOf: [WPMediaPickerViewController.self]).tintColor = .editorPrimary + + UIView.appearance(whenContainedInInstancesOf: [WPMediaPickerViewController.self, WPSplitViewController.self]).tintColor = .primary + } } From ab3539cb562a8ca6aa8d4cd595505326d7851b3f Mon Sep 17 00:00:00 2001 From: Siobhan Date: Tue, 2 Aug 2022 16:08:59 +0100 Subject: [PATCH 25/35] Refine specificity of Post Settings tintColor call Previously, the tintColor for the menu items in Post Settings was being targetted via the 'UIView' element. This had the undesired side effect of also changing the tintColor for other UI elements in the editor. With this commit, 'UIView' has been changed to 'UITableView' in order to more specifically target the UI elements that should be changed. --- WordPress/Classes/System/WordPressAppDelegate.swift | 2 +- .../ViewRelated/Post/Preview/PreviewWebKitViewController.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WordPress/Classes/System/WordPressAppDelegate.swift b/WordPress/Classes/System/WordPressAppDelegate.swift index a9d2ab56056b..c91699bc98a5 100644 --- a/WordPress/Classes/System/WordPressAppDelegate.swift +++ b/WordPress/Classes/System/WordPressAppDelegate.swift @@ -887,7 +887,7 @@ extension WordPressAppDelegate { /// Post Settings UITableView.appearance(whenContainedInInstancesOf: [PostSettingsViewController.self]).tintColor = .editorPrimary UISwitch.appearance(whenContainedInInstancesOf: [PostSettingsViewController.self]).onTintColor = .editorPrimary - UIView.appearance(whenContainedInInstancesOf: [AztecNavigationController.self]).tintColor = .editorPrimary + UITableView.appearance(whenContainedInInstancesOf: [AztecNavigationController.self]).tintColor = .editorPrimary if #available(iOS 14.0, *) { let editorSettingsDatePicker = UIView.appearance(whenContainedInInstancesOf: [SchedulingDatePickerViewController.self]) diff --git a/WordPress/Classes/ViewRelated/Post/Preview/PreviewWebKitViewController.swift b/WordPress/Classes/ViewRelated/Post/Preview/PreviewWebKitViewController.swift index f7d041d97d98..30debb00c8a0 100644 --- a/WordPress/Classes/ViewRelated/Post/Preview/PreviewWebKitViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/Preview/PreviewWebKitViewController.swift @@ -256,7 +256,7 @@ class PreviewWebKitViewController: WebKitViewController { static let publishButtonTitle = NSLocalizedString("Publish", comment: "Label for the publish (verb) button. Tapping publishes a draft post.") - static let publishButtonColor = UIColor.primary + static let publishButtonColor = UIColor.editorPrimary static let blankURL = URL(string: "about:blank") } From 233825fadf8c730497207dceffacf5c314c1e39c Mon Sep 17 00:00:00 2001 From: Siobhan Date: Tue, 2 Aug 2022 16:24:04 +0100 Subject: [PATCH 26/35] Add clarifying comments --- .../Classes/System/WordPressAppDelegate.swift | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/WordPress/Classes/System/WordPressAppDelegate.swift b/WordPress/Classes/System/WordPressAppDelegate.swift index c91699bc98a5..524257b4ae84 100644 --- a/WordPress/Classes/System/WordPressAppDelegate.swift +++ b/WordPress/Classes/System/WordPressAppDelegate.swift @@ -884,28 +884,29 @@ extension WordPressAppDelegate { // Editor styles - /// Post Settings + /// Post Settings: Main and subscreens UITableView.appearance(whenContainedInInstancesOf: [PostSettingsViewController.self]).tintColor = .editorPrimary - UISwitch.appearance(whenContainedInInstancesOf: [PostSettingsViewController.self]).onTintColor = .editorPrimary UITableView.appearance(whenContainedInInstancesOf: [AztecNavigationController.self]).tintColor = .editorPrimary + UISwitch.appearance(whenContainedInInstancesOf: [PostSettingsViewController.self]).onTintColor = .editorPrimary + /// Post Settings: Date picker if #available(iOS 14.0, *) { let editorSettingsDatePicker = UIView.appearance(whenContainedInInstancesOf: [SchedulingDatePickerViewController.self]) editorSettingsDatePicker.tintColor = .editorPrimary } - /// Post Setting Categories + /// Post Settings: Categories selection UIView.appearance(whenContainedInInstancesOf: [WPAddPostCategoryViewController.self]).tintColor = .editorPrimary + UIView.appearance(whenContainedInInstancesOf: [PostCategoriesViewController.self]).tintColor = .editorPrimary + /// It's necessary to target PostCategoriesViewController a second time to 'reset' + /// the UI element's `tintColor` for use in the app's Site Settings screen. + UIView.appearance(whenContainedInInstancesOf: [PostCategoriesViewController.self, WPSplitViewController.self]).tintColor = .primary - UIView.appearance(whenContainedInInstancesOf: [PostCategoriesViewController.self, UINavigationController.self]).tintColor = .editorPrimary - - UIView.appearance(whenContainedInInstancesOf: [PostCategoriesViewController.self, UINavigationController.self, WPSplitViewController.self]).tintColor = .primary - - /// Featured Image Search. + /// Post Settings: Featured Image Search UIView.appearance(whenContainedInInstancesOf: [WPMediaPickerViewController.self]).tintColor = .editorPrimary - + /// It's necessary to target WPMediaPickerViewController a second time to 'reset' + /// the UI element's `tintColor` for use app's main Media screen. UIView.appearance(whenContainedInInstancesOf: [WPMediaPickerViewController.self, WPSplitViewController.self]).tintColor = .primary - } } From fe504871eb1637d5ca391c204c87c36ba72a860c Mon Sep 17 00:00:00 2001 From: Siobhan Date: Tue, 2 Aug 2022 16:24:51 +0100 Subject: [PATCH 27/35] Apply tintColor to Post Settings tag selection --- WordPress/Classes/System/WordPressAppDelegate.swift | 3 +++ 1 file changed, 3 insertions(+) diff --git a/WordPress/Classes/System/WordPressAppDelegate.swift b/WordPress/Classes/System/WordPressAppDelegate.swift index 524257b4ae84..97f8ce9edee2 100644 --- a/WordPress/Classes/System/WordPressAppDelegate.swift +++ b/WordPress/Classes/System/WordPressAppDelegate.swift @@ -895,6 +895,9 @@ extension WordPressAppDelegate { editorSettingsDatePicker.tintColor = .editorPrimary } + /// Post Settings: Tag selection + UIView.appearance(whenContainedInInstancesOf: [PostTagPickerViewController.self]).tintColor = .editorPrimary + /// Post Settings: Categories selection UIView.appearance(whenContainedInInstancesOf: [WPAddPostCategoryViewController.self]).tintColor = .editorPrimary UIView.appearance(whenContainedInInstancesOf: [PostCategoriesViewController.self]).tintColor = .editorPrimary From 10ed59f7bdef647060c6de61b55789a0885aa7e0 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Tue, 2 Aug 2022 16:28:34 +0100 Subject: [PATCH 28/35] Add clarifying comments to code --- .../Classes/ViewRelated/Gutenberg/GutenbergViewController.swift | 2 ++ 1 file changed, 2 insertions(+) diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index 7a373eecaa84..c35259807143 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -374,6 +374,7 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega super.viewWillAppear(animated) verificationPromptHelper?.updateVerificationStatus() ghostView.startAnimation() + // `.editorPrimary` should be the tintColor that's used for action sheets when the editor appears. UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = .editorPrimary } @@ -386,6 +387,7 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) + // Resets the action sheet's tintColor to `.primary` to prevent `.editorPrimary` being set as the tintColor for UI elements outside of the editor. UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = .primary } From 1d5ba16deeca697c600ac6932a3ebbe3752c7dce Mon Sep 17 00:00:00 2001 From: Siobhan Date: Tue, 2 Aug 2022 17:06:01 +0100 Subject: [PATCH 29/35] Revert accidental commit to previewController This change was committed accidentally, and won't be a part of this PR's changes. --- .../ViewRelated/Post/Preview/PreviewWebKitViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/WordPress/Classes/ViewRelated/Post/Preview/PreviewWebKitViewController.swift b/WordPress/Classes/ViewRelated/Post/Preview/PreviewWebKitViewController.swift index 30debb00c8a0..f7d041d97d98 100644 --- a/WordPress/Classes/ViewRelated/Post/Preview/PreviewWebKitViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/Preview/PreviewWebKitViewController.swift @@ -256,7 +256,7 @@ class PreviewWebKitViewController: WebKitViewController { static let publishButtonTitle = NSLocalizedString("Publish", comment: "Label for the publish (verb) button. Tapping publishes a draft post.") - static let publishButtonColor = UIColor.editorPrimary + static let publishButtonColor = UIColor.primary static let blankURL = URL(string: "about:blank") } From e034bc6b8833a069f49e09bfd63718aeb3ee6965 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Tue, 2 Aug 2022 17:06:23 +0100 Subject: [PATCH 30/35] Tweaks to comment spacing/wording for clarity --- WordPress/Classes/System/WordPressAppDelegate.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/WordPress/Classes/System/WordPressAppDelegate.swift b/WordPress/Classes/System/WordPressAppDelegate.swift index 97f8ce9edee2..c2499d7f781f 100644 --- a/WordPress/Classes/System/WordPressAppDelegate.swift +++ b/WordPress/Classes/System/WordPressAppDelegate.swift @@ -882,7 +882,7 @@ extension WordPressAppDelegate { WPActionBar.appearance().barBackgroundColor = .basicBackground WPActionBar.appearance().lineColor = .basicBackground - // Editor styles + // Post Settings styles /// Post Settings: Main and subscreens UITableView.appearance(whenContainedInInstancesOf: [PostSettingsViewController.self]).tintColor = .editorPrimary @@ -901,12 +901,14 @@ extension WordPressAppDelegate { /// Post Settings: Categories selection UIView.appearance(whenContainedInInstancesOf: [WPAddPostCategoryViewController.self]).tintColor = .editorPrimary UIView.appearance(whenContainedInInstancesOf: [PostCategoriesViewController.self]).tintColor = .editorPrimary + /// It's necessary to target PostCategoriesViewController a second time to 'reset' /// the UI element's `tintColor` for use in the app's Site Settings screen. UIView.appearance(whenContainedInInstancesOf: [PostCategoriesViewController.self, WPSplitViewController.self]).tintColor = .primary /// Post Settings: Featured Image Search UIView.appearance(whenContainedInInstancesOf: [WPMediaPickerViewController.self]).tintColor = .editorPrimary + /// It's necessary to target WPMediaPickerViewController a second time to 'reset' /// the UI element's `tintColor` for use app's main Media screen. UIView.appearance(whenContainedInInstancesOf: [WPMediaPickerViewController.self, WPSplitViewController.self]).tintColor = .primary From 1eeb3ef1550ee9eedc3c5b64138fba37974024e3 Mon Sep 17 00:00:00 2001 From: Siobhan Bamber Date: Wed, 3 Aug 2022 11:25:22 +0100 Subject: [PATCH 31/35] Add clarifying comment Co-authored-by: David Calhoun <438664+dcalhoun@users.noreply.github.com> --- .../Classes/ViewRelated/Gutenberg/GutenbergViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index c35259807143..301501265ba6 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -573,6 +573,7 @@ extension GutenbergViewController { view.pinSubviewToAllEdges(gutenberg.rootView) gutenberg.rootView.pinSubviewToAllEdges(ghostView) + // Update the tint color of switches within React Native modals, as they require direct mutation UISwitch.appearance(whenContainedInInstancesOf: [RCTModalHostViewController.self]).onTintColor = .editorPrimary } } From 6b2d0d98a3622a9eb4aee9fb2e86ad8fd0b16b36 Mon Sep 17 00:00:00 2001 From: Siobhan Bamber Date: Wed, 3 Aug 2022 11:46:01 +0100 Subject: [PATCH 32/35] Add clarifying comment Co-authored-by: David Calhoun <438664+dcalhoun@users.noreply.github.com> --- .../Classes/ViewRelated/Gutenberg/GutenbergViewController.swift | 1 + 1 file changed, 1 insertion(+) diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index 301501265ba6..e842033237d8 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -415,6 +415,7 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega override func present(_ viewControllerToPresent: UIViewController, animated flag: Bool, completion: (() -> Void)? = nil) { super.present(viewControllerToPresent, animated: flag, completion: completion) + // Update the tint color for React Native modals when presented let presentedView = presentedViewController?.view presentedView?.tintColor = .editorPrimary } From 88689745d008e54e9a2f00b50bcc318b4156e9d2 Mon Sep 17 00:00:00 2001 From: Siobhan Date: Thu, 4 Aug 2022 11:34:23 +0100 Subject: [PATCH 33/35] Refine/improve calls to Post Settings screen With this commit, a redundant call to the PostSettingsViewController's 'UITableView' is removed. This call is 'covered' already by targeting AztecNavigationController's 'UITableView'. In addition, instead of targetting PostSettingsViewController's UISwitch, this commit updates the target to AztecNavigationController. AztecNavigationController is higher up in the view hierarchy, so will capture more UI elements. --- WordPress/Classes/System/WordPressAppDelegate.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/WordPress/Classes/System/WordPressAppDelegate.swift b/WordPress/Classes/System/WordPressAppDelegate.swift index c2499d7f781f..91c7ec65ca35 100644 --- a/WordPress/Classes/System/WordPressAppDelegate.swift +++ b/WordPress/Classes/System/WordPressAppDelegate.swift @@ -885,9 +885,8 @@ extension WordPressAppDelegate { // Post Settings styles /// Post Settings: Main and subscreens - UITableView.appearance(whenContainedInInstancesOf: [PostSettingsViewController.self]).tintColor = .editorPrimary UITableView.appearance(whenContainedInInstancesOf: [AztecNavigationController.self]).tintColor = .editorPrimary - UISwitch.appearance(whenContainedInInstancesOf: [PostSettingsViewController.self]).onTintColor = .editorPrimary + UISwitch.appearance(whenContainedInInstancesOf: [AztecNavigationController.self]).onTintColor = .editorPrimary /// Post Settings: Date picker if #available(iOS 14.0, *) { From a67b94b00015a2b56b4301550e4f73510837f19a Mon Sep 17 00:00:00 2001 From: Siobhan Date: Thu, 4 Aug 2022 23:01:35 +0100 Subject: [PATCH 34/35] Remove calls to change editor action sheets These calls are going to be replaced with direct calls in Gutenberg: https://github.com/WordPress/gutenberg/pull/42996 --- .../ViewRelated/Gutenberg/GutenbergViewController.swift | 4 ---- 1 file changed, 4 deletions(-) diff --git a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift index fa23c8887d6f..cdbb6949c318 100644 --- a/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift +++ b/WordPress/Classes/ViewRelated/Gutenberg/GutenbergViewController.swift @@ -374,8 +374,6 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega super.viewWillAppear(animated) verificationPromptHelper?.updateVerificationStatus() ghostView.startAnimation() - // `.editorPrimary` should be the tintColor that's used for action sheets when the editor appears. - UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = .editorPrimary } override func viewDidAppear(_ animated: Bool) { @@ -387,8 +385,6 @@ class GutenbergViewController: UIViewController, PostEditor, FeaturedImageDelega override func viewWillDisappear(_ animated: Bool) { super.viewWillDisappear(animated) - // Resets the action sheet's tintColor to `.primary` to prevent `.editorPrimary` being set as the tintColor for UI elements outside of the editor. - UIView.appearance(whenContainedInInstancesOf: [UIAlertController.self]).tintColor = .primary } override func viewLayoutMarginsDidChange() { From 56dab966a361844f1e30cdea8ce4d71218d0ae1b Mon Sep 17 00:00:00 2001 From: Siobhan Date: Fri, 5 Aug 2022 09:54:29 +0100 Subject: [PATCH 35/35] [Code quality] Refine calls to UI elements --- .../Classes/System/WordPressAppDelegate.swift | 23 ++----------------- .../WPAddPostCategoryViewController.m | 1 + .../Post/PostTagPickerViewController.swift | 1 + .../SchedulingDatePickerViewController.swift | 1 + 4 files changed, 5 insertions(+), 21 deletions(-) diff --git a/WordPress/Classes/System/WordPressAppDelegate.swift b/WordPress/Classes/System/WordPressAppDelegate.swift index 91c7ec65ca35..db095f86a5b7 100644 --- a/WordPress/Classes/System/WordPressAppDelegate.swift +++ b/WordPress/Classes/System/WordPressAppDelegate.swift @@ -883,34 +883,15 @@ extension WordPressAppDelegate { WPActionBar.appearance().lineColor = .basicBackground // Post Settings styles - - /// Post Settings: Main and subscreens UITableView.appearance(whenContainedInInstancesOf: [AztecNavigationController.self]).tintColor = .editorPrimary UISwitch.appearance(whenContainedInInstancesOf: [AztecNavigationController.self]).onTintColor = .editorPrimary - /// Post Settings: Date picker - if #available(iOS 14.0, *) { - let editorSettingsDatePicker = UIView.appearance(whenContainedInInstancesOf: [SchedulingDatePickerViewController.self]) - editorSettingsDatePicker.tintColor = .editorPrimary - } - - /// Post Settings: Tag selection - UIView.appearance(whenContainedInInstancesOf: [PostTagPickerViewController.self]).tintColor = .editorPrimary - - /// Post Settings: Categories selection - UIView.appearance(whenContainedInInstancesOf: [WPAddPostCategoryViewController.self]).tintColor = .editorPrimary + /// Sets the `tintColor` for parent category selection within the Post Settings screen UIView.appearance(whenContainedInInstancesOf: [PostCategoriesViewController.self]).tintColor = .editorPrimary - /// It's necessary to target PostCategoriesViewController a second time to 'reset' - /// the UI element's `tintColor` for use in the app's Site Settings screen. + /// It's necessary to target `PostCategoriesViewController` a second time to "reset" the UI element's `tintColor` for use in the app's Site Settings screen. UIView.appearance(whenContainedInInstancesOf: [PostCategoriesViewController.self, WPSplitViewController.self]).tintColor = .primary - /// Post Settings: Featured Image Search - UIView.appearance(whenContainedInInstancesOf: [WPMediaPickerViewController.self]).tintColor = .editorPrimary - - /// It's necessary to target WPMediaPickerViewController a second time to 'reset' - /// the UI element's `tintColor` for use app's main Media screen. - UIView.appearance(whenContainedInInstancesOf: [WPMediaPickerViewController.self, WPSplitViewController.self]).tintColor = .primary } } diff --git a/WordPress/Classes/ViewRelated/Post/Categories/WPAddPostCategoryViewController.m b/WordPress/Classes/ViewRelated/Post/Categories/WPAddPostCategoryViewController.m index c7a99fb4b8df..b8a15c1d1f50 100644 --- a/WordPress/Classes/ViewRelated/Post/Categories/WPAddPostCategoryViewController.m +++ b/WordPress/Classes/ViewRelated/Post/Categories/WPAddPostCategoryViewController.m @@ -40,6 +40,7 @@ - (void)viewDidLoad self.tableView.sectionFooterHeight = 0.0f; // Set this to 0 to avoid automattic sizing of cells and getting label cell to short. self.tableView.estimatedRowHeight = 0.0f; + self.view.tintColor = [UIColor murielEditorPrimary]; self.saveButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Save", @"Save button label (saving content, ex: Post, Page, Comment, Category).") style:[WPStyleGuide barButtonStyleForDone] diff --git a/WordPress/Classes/ViewRelated/Post/PostTagPickerViewController.swift b/WordPress/Classes/ViewRelated/Post/PostTagPickerViewController.swift index daecdc2af003..b86bb9f771fa 100644 --- a/WordPress/Classes/ViewRelated/Post/PostTagPickerViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/PostTagPickerViewController.swift @@ -41,6 +41,7 @@ class PostTagPickerViewController: UIViewController { WPStyleGuide.configureTableViewColors(tableView: tableView) view.backgroundColor = .listBackground + view.tintColor = .editorPrimary textView.delegate = self // Do any additional setup after loading the view, typically from a nib. diff --git a/WordPress/Classes/ViewRelated/Post/Scheduling/SchedulingDatePickerViewController.swift b/WordPress/Classes/ViewRelated/Post/Scheduling/SchedulingDatePickerViewController.swift index 6d75a153ed8d..ce9a68378a9f 100644 --- a/WordPress/Classes/ViewRelated/Post/Scheduling/SchedulingDatePickerViewController.swift +++ b/WordPress/Classes/ViewRelated/Post/Scheduling/SchedulingDatePickerViewController.swift @@ -73,6 +73,7 @@ class SchedulingDatePickerViewController: UIViewController, DatePickerSheet, Dat navigationItem.setRightBarButton(doneButton, animated: false) setup(topView: chosenValueRow, pickerView: datePickerView) + view.tintColor = .editorPrimary setupForAccessibility() }