Mhurd has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/140863

Change subject: Slight increase to canned edit summary button height.
......................................................................

Slight increase to canned edit summary button height.

Deleted cruft font.

Progressive text buttons bold text per Jared.

Change-Id: Id15670a702cda22fb87167ac6305ece206a26d8d
---
D wikipedia/Fonts/WikiFont-iOS.ttf
M wikipedia/MenuButton/MenuButton.h
M wikipedia/MenuButton/MenuButton.m
M wikipedia/MenuLabel/MenuLabel.h
M wikipedia/MenuLabel/MenuLabel.m
M wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m
M wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m
7 files changed, 34 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/ios/wikipedia 
refs/changes/63/140863/1

diff --git a/wikipedia/Fonts/WikiFont-iOS.ttf b/wikipedia/Fonts/WikiFont-iOS.ttf
deleted file mode 100644
index 7510ba9..0000000
--- a/wikipedia/Fonts/WikiFont-iOS.ttf
+++ /dev/null
Binary files differ
diff --git a/wikipedia/MenuButton/MenuButton.h 
b/wikipedia/MenuButton/MenuButton.h
index fff2a59..a75b9b8 100755
--- a/wikipedia/MenuButton/MenuButton.h
+++ b/wikipedia/MenuButton/MenuButton.h
@@ -9,6 +9,7 @@
 
 - (instancetype)initWithText: (NSString *)text
                     fontSize: (CGFloat)size
+                        bold: (BOOL)bold
                        color: (UIColor *)color
                      padding: (UIEdgeInsets)padding
                       margin: (UIEdgeInsets)margin;
diff --git a/wikipedia/MenuButton/MenuButton.m 
b/wikipedia/MenuButton/MenuButton.m
index 8ecd1f2..f24e407 100755
--- a/wikipedia/MenuButton/MenuButton.m
+++ b/wikipedia/MenuButton/MenuButton.m
@@ -17,6 +17,8 @@
 
 @property (nonatomic) CGFloat fontSize;
 
+@property (nonatomic) BOOL fontBold;
+
 @property (nonatomic) UIEdgeInsets padding;
 
 @property (nonatomic) UIEdgeInsets margin;
@@ -27,16 +29,17 @@
 
 - (instancetype)initWithCoder:(NSCoder *)coder
 {
-    return [self initWithText:@"" fontSize:16 color:[UIColor blackColor] 
padding:UIEdgeInsetsZero margin:UIEdgeInsetsZero];
+    return [self initWithText:@"" fontSize:16 bold:NO color:[UIColor 
blackColor] padding:UIEdgeInsetsZero margin:UIEdgeInsetsZero];
 }
 
 - (instancetype)init
 {
-    return [self initWithText:@"" fontSize:16 color:[UIColor blackColor] 
padding:UIEdgeInsetsZero margin:UIEdgeInsetsZero];
+    return [self initWithText:@"" fontSize:16 bold:NO color:[UIColor 
blackColor] padding:UIEdgeInsetsZero margin:UIEdgeInsetsZero];
 }
 
 - (instancetype)initWithText: (NSString *)text
                     fontSize: (CGFloat)size
+                        bold: (BOOL)bold
                        color: (UIColor *)color
                      padding: (UIEdgeInsets)padding
                       margin: (UIEdgeInsets)margin
@@ -49,7 +52,8 @@
         self.text = text;
         self.enabled = NO;
         self.clipsToBounds = YES;
-        self.label = [[MenuLabel alloc] initWithText:text fontSize:size 
color:color padding:padding];
+        self.fontBold = bold;
+        self.label = [[MenuLabel alloc] initWithText:text fontSize:size 
bold:bold color:color padding:padding];
         self.color = color;
         self.oldColor = color;
         [self addSubview:self.label];
diff --git a/wikipedia/MenuLabel/MenuLabel.h b/wikipedia/MenuLabel/MenuLabel.h
index cea051b..072f9ea 100755
--- a/wikipedia/MenuLabel/MenuLabel.h
+++ b/wikipedia/MenuLabel/MenuLabel.h
@@ -7,6 +7,7 @@
 
 - (instancetype)initWithText: (NSString *)text
                     fontSize: (CGFloat)size
+                        bold: (BOOL)bold
                        color: (UIColor *)color
                      padding: (UIEdgeInsets)padding;
 
diff --git a/wikipedia/MenuLabel/MenuLabel.m b/wikipedia/MenuLabel/MenuLabel.m
index 7a4d264..e008d52 100755
--- a/wikipedia/MenuLabel/MenuLabel.m
+++ b/wikipedia/MenuLabel/MenuLabel.m
@@ -11,6 +11,8 @@
 
 @property (nonatomic) CGFloat fontSize;
 
+@property (nonatomic) BOOL fontBold;
+
 @property (nonatomic) UIEdgeInsets padding;
 
 @end
@@ -19,16 +21,17 @@
 
 - (instancetype)init
 {
-    return [self initWithText:@"" fontSize:16 color:[UIColor blackColor] 
padding:UIEdgeInsetsZero];
+    return [self initWithText:@"" fontSize:16 bold:NO color:[UIColor 
blackColor] padding:UIEdgeInsetsZero];
 }
 
 - (instancetype)initWithCoder:(NSCoder *)coder
 {
-    return [self initWithText:@"" fontSize:16 color:[UIColor blackColor] 
padding:UIEdgeInsetsZero];
+    return [self initWithText:@"" fontSize:16 bold:NO color:[UIColor 
blackColor] padding:UIEdgeInsetsZero];
 }
 
 - (instancetype)initWithText: (NSString *)text
                     fontSize: (CGFloat)size
+                        bold: (BOOL)bold
                        color: (UIColor *)color
                      padding: (UIEdgeInsets)padding
 {
@@ -36,6 +39,7 @@
     if (self) {
         self.translatesAutoresizingMaskIntoConstraints = NO;
         self.padding = padding;
+        self.fontBold = bold;
         self.color = color;
         self.fontSize = size;
         self.textAlignment = NSTextAlignmentCenter;
@@ -59,9 +63,10 @@
 
 -(void)setText:(NSString *)text
 {
+    UIFont *font = (self.fontBold) ? [UIFont 
boldSystemFontOfSize:self.fontSize] : [UIFont systemFontOfSize:self.fontSize];
     NSDictionary *attributes =
     @{
-      NSFontAttributeName: [UIFont systemFontOfSize:self.fontSize],
+      NSFontAttributeName: font,
       NSForegroundColorAttributeName : self.color
       };
     
diff --git a/wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m 
b/wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m
index 7d1a467..1fac254 100644
--- a/wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m
+++ b/wikipedia/View Controllers/Navigation/Top/TopMenuViewController.m
@@ -265,6 +265,7 @@
         
         MenuButton *button = [[MenuButton alloc] initWithText: string
                                                      fontSize: size
+                                                         bold: YES
                                                         color: color
                                                       padding: 
UIEdgeInsetsMake(0, 16, 0, 16)
                                                        margin: 
UIEdgeInsetsMake(8, 9, 7, 10)];
diff --git a/wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m 
b/wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m
index 2fe4e0c..1995921 100644
--- a/wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m
+++ b/wikipedia/View Controllers/Preview/PreviewAndSaveViewController.m
@@ -225,13 +225,17 @@
                             @"cannedSummary04": self.cannedSummary04
                             };
     
+    NSDictionary *metrics = @{
+                            @"buttonHeight": @(48)
+                            };
+    
     NSArray *constraints = @[
-        [NSLayoutConstraint constraintsWithVisualFormat:@"H:|[aboutLabel]|" 
options:0 metrics:nil views:views],
-        [NSLayoutConstraint 
constraintsWithVisualFormat:@"H:|[cannedSummary01]" options:0 metrics:nil 
views:views],
-        [NSLayoutConstraint 
constraintsWithVisualFormat:@"H:|[cannedSummary02]" options:0 metrics:nil 
views:views],
-        [NSLayoutConstraint 
constraintsWithVisualFormat:@"H:|[cannedSummary03]" options:0 metrics:nil 
views:views],
-        [NSLayoutConstraint 
constraintsWithVisualFormat:@"H:|[cannedSummary04]" options:0 metrics:nil 
views:views],
-        [NSLayoutConstraint 
constraintsWithVisualFormat:@"V:|-(40)-[aboutLabel]-(5)-[cannedSummary01][cannedSummary02][cannedSummary03][cannedSummary04]-(43)-|"
 options:0 metrics:nil views:views]
+        [NSLayoutConstraint constraintsWithVisualFormat:@"H:|[aboutLabel]|" 
options:0 metrics:metrics views:views],
+        [NSLayoutConstraint 
constraintsWithVisualFormat:@"H:|[cannedSummary01]" options:0 metrics:metrics 
views:views],
+        [NSLayoutConstraint 
constraintsWithVisualFormat:@"H:|[cannedSummary02]" options:0 metrics:metrics 
views:views],
+        [NSLayoutConstraint 
constraintsWithVisualFormat:@"H:|[cannedSummary03]" options:0 metrics:metrics 
views:views],
+        [NSLayoutConstraint 
constraintsWithVisualFormat:@"H:|[cannedSummary04]" options:0 metrics:metrics 
views:views],
+        [NSLayoutConstraint 
constraintsWithVisualFormat:@"V:|-(40)-[aboutLabel]-(5)-[cannedSummary01(buttonHeight)][cannedSummary02(buttonHeight)][cannedSummary03(buttonHeight)][cannedSummary04(buttonHeight)]-(43)-|"
 options:0 metrics:metrics views:views]
     ];
     [self.editSummaryContainer addConstraints:[constraints 
valueForKeyPath:@"@unionOfArrays.self"]];
 }
@@ -245,7 +249,12 @@
     CGFloat fontSize = 14;
     
     MenuButton * (^setupButton)(NSString *, NSInteger) = ^MenuButton 
*(NSString *text, NSInteger tag) {
-        MenuButton *button = [[MenuButton alloc] initWithText:text 
fontSize:fontSize color:color padding:padding margin:margin];
+        MenuButton *button = [[MenuButton alloc] initWithText: text
+                                                     fontSize: fontSize
+                                                         bold: NO
+                                                        color: color
+                                                      padding: padding
+                                                       margin: margin];
         button.enabled = NO;
         button.tag = tag;
         [button addGestureRecognizer:[[UITapGestureRecognizer alloc] 
initWithTarget:self action:@selector(buttonTapped:)]];

-- 
To view, visit https://gerrit.wikimedia.org/r/140863
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Id15670a702cda22fb87167ac6305ece206a26d8d
Gerrit-PatchSet: 1
Gerrit-Project: apps/ios/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Mhurd <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to