فهرست منبع

Theming color

Marino Faggiana 8 سال پیش
والد
کامیت
8a39e69f8f
3فایلهای تغییر یافته به همراه14 افزوده شده و 3 حذف شده
  1. 3 0
      iOSClient/AppDelegate.h
  2. 3 0
      iOSClient/AppDelegate.m
  3. 8 3
      iOSClient/Main/CCMain.m

+ 3 - 0
iOSClient/AppDelegate.h

@@ -145,6 +145,9 @@
 // Is in Crypto Mode
 @property BOOL isCryptoCloudMode;
 
+// Theming Color
+@property (nonatomic, strong) UIColor *themingColor;
+
 // Setting Active Account
 - (void)settingActiveAccount:(NSString *)activeAccount activeUrl:(NSString *)activeUrl activeUser:(NSString *)activeUser activePassword:(NSString *)activePassword;
 

+ 3 - 0
iOSClient/AppDelegate.m

@@ -203,6 +203,9 @@
     self.player = [LMMediaPlayerView sharedPlayerView];
     self.player.delegate = self;
     
+    // Theming Color
+    self.themingColor = [NCBrandColor sharedInstance].brand;
+    
     // ico Image Cache
     self.icoImagesCache = [[NSMutableDictionary alloc] init];
     

+ 8 - 3
iOSClient/Main/CCMain.m

@@ -1198,11 +1198,16 @@
     [CCCoreData addCapabilities:capabilities account:app.activeAccount];
     
     // Change Theming color
-    if (k_option_use_themingColor == YES && ![oldCapabilities.themingColor isEqualToString:capabilities.themingColor]) {
+    if (k_option_use_themingColor) {
         
-        [[NSNotificationCenter defaultCenter] postNotificationName:@"changeTheming" object:nil];
+        app.themingColor = [CCGraphics colorFromHexString:capabilities.themingColor];
         
-        self.navigationController.navigationBar.barTintColor = [NCBrandColor sharedInstance].navigationBar;
+        if (![oldCapabilities.themingColor isEqualToString:capabilities.themingColor]) {
+         
+            [[NSNotificationCenter defaultCenter] postNotificationName:@"changeTheming" object:nil];
+
+            self.navigationController.navigationBar.barTintColor = app.themingColor;
+        }
     }
     
     // Search bar if change version