forked from organicmaps/organicmaps
[ios] add red style for the main tab bar button
Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
parent
5eef1ef00d
commit
970899cb05
3 changed files with 16 additions and 1 deletions
|
@ -5,7 +5,8 @@ typedef NS_ENUM(NSUInteger, MWMButtonColoring)
|
|||
MWMButtonColoringBlack,
|
||||
MWMButtonColoringWhite,
|
||||
MWMButtonColoringWhiteText,
|
||||
MWMButtonColoringGray
|
||||
MWMButtonColoringGray,
|
||||
MWMButtonColoringRed
|
||||
};
|
||||
|
||||
@interface MWMButton : UIButton
|
||||
|
|
|
@ -68,6 +68,9 @@ static NSString * const kSelectedPattern = @"%@_selected_%@";
|
|||
case MWMButtonColoringGray:
|
||||
self.tintColor = [UIColor blackDividers];
|
||||
break;
|
||||
case MWMButtonColoringRed:
|
||||
self.tintColor = [[UIColor buttonRed] colorWithAlphaComponent:0.5];
|
||||
break;
|
||||
case MWMButtonColoringWhiteText:
|
||||
self.tintColor = [UIColor whitePrimaryTextHighlighted];
|
||||
break;
|
||||
|
@ -100,6 +103,7 @@ static NSString * const kSelectedPattern = @"%@_selected_%@";
|
|||
case MWMButtonColoringBlue:
|
||||
case MWMButtonColoringOther:
|
||||
case MWMButtonColoringGray:
|
||||
case MWMButtonColoringRed:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -137,9 +141,12 @@ static NSString * const kSelectedPattern = @"%@_selected_%@";
|
|||
case MWMButtonColoringGray:
|
||||
self.tintColor = [UIColor blackHintText];
|
||||
break;
|
||||
case MWMButtonColoringRed:
|
||||
self.tintColor = [UIColor buttonRed];
|
||||
case MWMButtonColoringOther:
|
||||
self.imageView.image = [self imageForState:UIControlStateNormal];
|
||||
break;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -157,6 +164,8 @@ static NSString * const kSelectedPattern = @"%@_selected_%@";
|
|||
self.coloring = MWMButtonColoringOther;
|
||||
else if ([coloring isEqualToString:@"MWMGray"])
|
||||
self.coloring = MWMButtonColoringGray;
|
||||
else if ([coloring isEqualToString:@"MWMRed"])
|
||||
self.coloring = MWMButtonColoringRed;
|
||||
else
|
||||
NSAssert(false, @"Invalid UIButton's coloring!");
|
||||
}
|
||||
|
|
|
@ -348,5 +348,10 @@ class GlobalStyleSheet: IStyleSheet {
|
|||
s.tintColor = colors.white
|
||||
s.coloring = MWMButtonColoring.white
|
||||
}
|
||||
|
||||
theme.add(styleName: "MWMRed") { (s) -> (Void) in
|
||||
s.tintColor = colors.buttonRed
|
||||
s.coloring = MWMButtonColoring.blue
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue