--- a/project_files/HedgewarsMobile/Classes/ExtraCategories.m Tue Sep 08 19:20:58 2015 +0300
+++ b/project_files/HedgewarsMobile/Classes/ExtraCategories.m Mon Nov 16 22:57:24 2015 +0300
@@ -27,17 +27,18 @@
-(CGFloat) safeScale {
CGFloat theScale = 1.0f;
- if ([self respondsToSelector:@selector(scale)])
- theScale = [self scale];
+// if ([self respondsToSelector:@selector(scale)])
+// theScale = [self scale];
return theScale;
}
-(CGRect) safeBounds {
- CGRect original = [self bounds];
- if (IS_ON_PORTRAIT())
- return original;
- else
- return CGRectMake(original.origin.x, original.origin.y, original.size.height, original.size.width);
+ return [self bounds];
+// CGRect original = [self bounds];
+// if (IS_ON_PORTRAIT())
+// return original;
+// else
+// return CGRectMake(original.origin.x, original.origin.y, original.size.height, original.size.width);
}
@end
@@ -99,17 +100,35 @@
-(id) initWithFrame:(CGRect) frame andTitle:(NSString *)title {
[self initWithFrame:frame];
[self setTitle:title forState:UIControlStateNormal];
+ [self applyBlackQuickStyle];
+
+ return self;
+}
+
+- (void)applyBlackQuickStyle
+{
[self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[self setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted];
self.titleLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
self.backgroundColor = [UIColor blackColorTransparent];
-
- [self.layer setBorderWidth:1];
+
+ [self.layer setBorderWidth:1.0f];
[self.layer setBorderColor:[[UIColor darkYellowColor] CGColor]];
[self.layer setCornerRadius:9.0f];
[self.layer setMasksToBounds:YES];
+}
- return self;
+- (void)applyDarkBlueQuickStyle
+{
+ [self setTitleColor:[UIColor darkYellowColor] forState:UIControlStateNormal];
+ [self setTitleColor:[UIColor grayColor] forState:UIControlStateHighlighted];
+ self.titleLabel.font = [UIFont boldSystemFontOfSize:[UIFont labelFontSize]];
+ self.backgroundColor = [UIColor darkBlueColorTransparent];
+
+ [self.layer setBorderWidth:2.0f];
+ [self.layer setBorderColor:[[UIColor darkYellowColor] CGColor]];
+ [self.layer setCornerRadius:9.0f];
+ [self.layer setMasksToBounds:YES];
}
@end