diff --git a/Signal/src/ViewControllers/HomeView/HomeViewController.m b/Signal/src/ViewControllers/HomeView/HomeViewController.m index ed6e1e75d..ac3585d95 100644 --- a/Signal/src/ViewControllers/HomeView/HomeViewController.m +++ b/Signal/src/ViewControllers/HomeView/HomeViewController.m @@ -412,7 +412,8 @@ NSString *const kArchivedConversationsReuseIdentifier = @"kArchivedConversations // UIBarButtonItem in order to ensure that these buttons are spaced tightly. // The contents of the navigation bar are cramped in this view. UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom]; - UIImage *image = [UIImage imageNamed:@"button_settings_white"]; + UIImage *image = [[UIImage imageNamed:@"button_settings_white"] imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate]; + button.tintColor = UIColor.ows_navbarForegroundColor; [button setImage:image forState:UIControlStateNormal]; UIEdgeInsets imageEdgeInsets = UIEdgeInsetsZero; // We normally would want to use left and right insets that ensure the button diff --git a/SignalMessaging/categories/UIColor+OWS.h b/SignalMessaging/categories/UIColor+OWS.h index f65f219f6..d7445efca 100644 --- a/SignalMessaging/categories/UIColor+OWS.h +++ b/SignalMessaging/categories/UIColor+OWS.h @@ -8,6 +8,13 @@ NS_ASSUME_NONNULL_BEGIN @interface UIColor (OWS) +#pragma mark - Global App Colors + +@property (class, readonly, nonatomic) UIColor *ows_navbarBackgroundColor; +@property (class, readonly, nonatomic) UIColor *ows_navbarForegroundColor; + +#pragma mark - + @property (class, readonly, nonatomic) UIColor *ows_systemPrimaryButtonColor; @property (class, readonly, nonatomic) UIColor *ows_signalBrandBlueColor; @property (class, readonly, nonatomic) UIColor *ows_materialBlueColor; diff --git a/SignalMessaging/categories/UIColor+OWS.m b/SignalMessaging/categories/UIColor+OWS.m index a456c680e..1fe9aa645 100644 --- a/SignalMessaging/categories/UIColor+OWS.m +++ b/SignalMessaging/categories/UIColor+OWS.m @@ -10,6 +10,22 @@ NS_ASSUME_NONNULL_BEGIN @implementation UIColor (OWS) +#pragma mark - Global App Colors + ++ (UIColor *)ows_navbarBackgroundColor +{ + return UIColor.ows_whiteColor; +} + ++ (UIColor *)ows_navbarForegroundColor +{ +// return UIColor.ows_blackColor; + + return UIColor.greenColor; +} + +#pragma mark - + + (UIColor *)ows_signalBrandBlueColor { return [UIColor colorWithRed:0.1135657504 green:0.4787300229 blue:0.89595204589999999 alpha:1.]; diff --git a/SignalMessaging/utils/UIUtil.m b/SignalMessaging/utils/UIUtil.m index 1642d75a3..514f2c226 100644 --- a/SignalMessaging/utils/UIUtil.m +++ b/SignalMessaging/utils/UIUtil.m @@ -1,8 +1,9 @@ // -// Copyright (c) 2017 Open Whisper Systems. All rights reserved. +// Copyright (c) 2018 Open Whisper Systems. All rights reserved. // #import "UIUtil.h" +#import "UIColor+OWS.h" #import #define CONTACT_PICTURE_VIEW_BORDER_WIDTH 0.5f @@ -34,31 +35,32 @@ + (void)applyDefaultSystemAppearence { - [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleDefault]; - [[UINavigationBar appearance] setBarStyle:UIBarStyleDefault]; - [[UINavigationBar appearance] setTintColor:[UIColor blackColor]]; - [[UIBarButtonItem appearance] setTintColor:[UIColor blackColor]]; - [[UINavigationBar appearance] setTitleTextAttributes:@{ - NSForegroundColorAttributeName : [UIColor blackColor], - }]; +// [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleDefault]; +// [[UINavigationBar appearance] setBarStyle:UIBarStyleDefault]; +// [[UINavigationBar appearance] setTintColor:[UIColor blackColor]]; +// [[UIBarButtonItem appearance] setTintColor:[UIColor blackColor]]; +// [[UINavigationBar appearance] setTitleTextAttributes:@{ +// NSForegroundColorAttributeName : [UIColor blackColor], +// }]; } + (void)applySignalAppearence { - [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleLightContent]; - [[UINavigationBar appearance] setBarTintColor:[UIColor ows_materialBlueColor]]; - [[UINavigationBar appearance] setTintColor:[UIColor whiteColor]]; + // [CurrentAppContext() setStatusBarStyle:UIStatusBarStyleLightContent]; + UINavigationBar.appearance.barTintColor = UIColor.ows_navbarBackgroundColor; + // [[UINavigationBar appearance] setBarTintColor:[UIColor ows_materialBlueColor]]; + UINavigationBar.appearance.tintColor = UIColor.ows_navbarForegroundColor; - [[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil] setTintColor:[UIColor ows_materialBlueColor]]; +// [[UIBarButtonItem appearanceWhenContainedIn:[UISearchBar class], nil] setTintColor:[UIColor ows_materialBlueColor]]; [[UISwitch appearance] setOnTintColor:[UIColor ows_materialBlueColor]]; [[UIToolbar appearance] setTintColor:[UIColor ows_materialBlueColor]]; - [[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]]; +// [[UIBarButtonItem appearance] setTintColor:[UIColor whiteColor]]; // If we set NSShadowAttributeName, the NSForegroundColorAttributeName value is ignored. - [[UINavigationBar appearance] setTitleTextAttributes:@{ - NSForegroundColorAttributeName : [UIColor whiteColor], - }]; + UINavigationBar.appearance.titleTextAttributes = @{ + NSForegroundColorAttributeName : UIColor.ows_navbarForegroundColor + }; } @end