marinofaggiana 4 lat temu
rodzic
commit
b0bfdbed28
1 zmienionych plików z 24 dodań i 9 usunięć
  1. 24 9
      iOSClient/AppDelegate.m

+ 24 - 9
iOSClient/AppDelegate.m

@@ -970,23 +970,38 @@
 
         [CCGraphics settingThemingColor:themingColor themingColorElement:themingColorElement themingColorText:themingColorText];
         
-        UIColor *color = NCBrandColor.sharedInstance.brand;
-        BOOL isTooLight = NCBrandColor.sharedInstance.brand.isTooLight;
-        BOOL isTooDark = NCBrandColor.sharedInstance.brand.isTooDark;
+        BOOL isTooLight = NCBrandColor.sharedInstance.brandElement.isTooLight;
+        BOOL isTooDark = NCBrandColor.sharedInstance.brandElement.isTooDark;
         
         if (isTooLight) {
-            color = [NCBrandColor.sharedInstance.brand darkerBy:10];
+            NCBrandColor.sharedInstance.brandElement = [NCBrandColor.sharedInstance.brandElement darkerBy:10];
+            NCBrandColor.sharedInstance.brand = [NCBrandColor.sharedInstance.brand darkerBy:10];
         } else if (isTooDark) {
-            color = [NCBrandColor.sharedInstance.brand lighterBy:10];
+            NCBrandColor.sharedInstance.brandElement = [NCBrandColor.sharedInstance.brandElement lighterBy:15];
+            NCBrandColor.sharedInstance.brand = [NCBrandColor.sharedInstance.brand lighterBy:15];
         }
-        
-        NCBrandColor.sharedInstance.brand = color;
-            
+    
     } else {
     
+        BOOL isTooLight = NCBrandColor.sharedInstance.customer.isTooLight;
+        BOOL isTooDark = NCBrandColor.sharedInstance.customer.isTooDark;
+        
+        if (isTooLight) {
+            NCBrandColor.sharedInstance.brandElement = [NCBrandColor.sharedInstance.customer darkerBy:10];
+        } else if (isTooDark) {
+            NCBrandColor.sharedInstance.brandElement = [NCBrandColor.sharedInstance.customer lighterBy:15];
+        } else {
+            NCBrandColor.sharedInstance.brandElement = NCBrandColor.sharedInstance.customer;
+        }
+        
         NCBrandColor.sharedInstance.brand = NCBrandColor.sharedInstance.customer;
-        NCBrandColor.sharedInstance.brandElement = NCBrandColor.sharedInstance.customer;
         NCBrandColor.sharedInstance.brandText = NCBrandColor.sharedInstance.customerText;
+        
+        /*
+         NCBrandColor.sharedInstance.brand = NCBrandColor.sharedInstance.customer;
+         NCBrandColor.sharedInstance.brandElement = NCBrandColor.sharedInstance.customer;
+         NCBrandColor.sharedInstance.brandText = NCBrandColor.sharedInstance.customerText;
+         */
     }
         
     [NCBrandColor.sharedInstance setDarkMode];