marinofaggiana 5 rokov pred
rodič
commit
d9e5baf4f9

+ 1 - 1
iOSClient/Brand/NCBrand.swift

@@ -67,7 +67,7 @@ class NCBrandColor: NSObject {
             tabBar = .black
             backgroundView = .black
             backgroundMenu = .darkGray
-            backgroundForm = UIColor(red: 30.0/255.0, green: 30.0/255.0, blue: 30.0/255.0, alpha: 1.0)
+            backgroundForm = UIColor(red: 50.0/255.0, green: 50.0/255.0, blue: 50.0/255.0, alpha: 1.0)
             textView = .white
             separator = UIColor(red: 60.0/255.0, green: 60.0/255.0, blue: 60.0/255.0, alpha: 1.0)
         } else {

+ 8 - 10
iOSClient/Main/CCMain.m

@@ -2027,22 +2027,19 @@
     
     item.title = NSLocalizedString(@"_add_account_", nil);
     item.argument = @"";
-    item.image = [UIImage imageNamed:@"add"];
+    item.image = [CCGraphics changeThemingColorImage:[UIImage imageNamed:@"add"] width:50 height:50 color:[NCBrandColor sharedInstance].textView];
     item.target = self;
     item.action = @selector(addNewAccount:);
     
     [menuArray addObject:item];
     
     OptionalConfiguration options;
-    Color textColor, backgroundColor;
+    Color backgroundColor;
     
-    textColor.R = 0;
-    textColor.G = 0;
-    textColor.B = 0;
-    
-    backgroundColor.R = 1;
-    backgroundColor.G = 1;
-    backgroundColor.B = 1;
+    const CGFloat *componentsBackgroundColor = CGColorGetComponents(NCBrandColor.sharedInstance.backgroundForm.CGColor);
+    backgroundColor.R = componentsBackgroundColor[0];
+    backgroundColor.G = componentsBackgroundColor[1];
+    backgroundColor.B = componentsBackgroundColor[2];
     
     options.arrowSize = 9;
     options.marginXSpacing = 7;
@@ -2053,8 +2050,9 @@
     options.shadowOfMenu = YES;
     options.hasSeperatorLine = YES;
     options.seperatorLineHasInsets = YES;
-    options.textColor = textColor;
+    options.textColor = NCBrandColor.sharedInstance.textView;
     options.menuBackgroundColor = backgroundColor;
+    options.separatorColor = NCBrandColor.sharedInstance.separator;
     
     CGRect rect = self.view.frame;
     CGFloat locationY = [theGestureRecognizer locationInView: self.navigationController.navigationBar].y;

+ 2 - 1
iOSClient/MenuAccount/CCMenuAccount.h

@@ -56,7 +56,8 @@ typedef struct {
     Boolean shadowOfMenu;
     Boolean hasSeperatorLine;
     Boolean seperatorLineHasInsets;
-    Color textColor;
+    UIColor *textColor;
+    UIColor *separatorColor;
     Color menuBackgroundColor;
     
 } OptionalConfiguration;

+ 6 - 6
iOSClient/MenuAccount/CCMenuAccount.m

@@ -335,7 +335,7 @@ typedef enum {
         insets = 4;
     }
     
-    UIImage *gradientLine = [CCMenuView gradientLine: (CGSize){maxItemWidth- kMarginX * insets, 0.4}];
+    UIImage *gradientLine = [CCMenuView gradientLine: (CGSize){maxItemWidth- kMarginX * insets, 0.4} color:self.CCMenuViewOptions.separatorColor];
     
     UIView *contentView = [[UIView alloc] initWithFrame:CGRectZero];
     contentView.autoresizingMask = UIViewAutoresizingNone;
@@ -408,8 +408,7 @@ typedef enum {
             titleLabel.font = titleFont;
             titleLabel.textAlignment = menuItem.alignment;
             
-            //titleLabel.textColor = menuItem.foreColor ? menuItem.foreColor : [UIColor blackColor];
-            titleLabel.textColor = [UIColor colorWithRed:self.CCMenuViewOptions.textColor.R green:self.CCMenuViewOptions.textColor.G blue:self.CCMenuViewOptions.textColor.B alpha:1];
+            titleLabel.textColor = self.CCMenuViewOptions.textColor;
             
             titleLabel.backgroundColor = [UIColor clearColor];
             
@@ -500,11 +499,12 @@ typedef enum {
     return [self gradientImageWithSize:size locations:locations components:components count:2];
 }
 
-+ (UIImage *)gradientLine:(CGSize)size
++ (UIImage *)gradientLine:(CGSize)size color:(UIColor *)color
 {
+    if (color == nil) color = UIColor.lightGrayColor;
     const CGFloat locations[5] = {0,0.2,0.5,0.8,1};
-    
-    const CGFloat R = 0.890f, G = 0.890f, B = 0.890f;
+    const CGFloat *componentsColor = CGColorGetComponents(color.CGColor);
+    const CGFloat R = componentsColor[0], G = componentsColor[1], B = componentsColor[2];
     
     const CGFloat components[20] = {
         R,G,B,1,