Update title label size
authorjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Jan 2018 01:54:06 +0000 (01:54 +0000)
committerjonlee@apple.com <jonlee@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Jan 2018 01:54:06 +0000 (01:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=181962
rdar://problem/36754744

Reviewed by Simon Fraser.

* UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
(-[_WKFullScreenViewController setLocation:secure:trustedName:trustedSite:]): Move titleLabel properties into
createSubviews.
(-[_WKFullScreenViewController createSubviews]): Set the title label for both the cancel and location buttons.
Refer to a const CGFloat for the font size.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227378 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKFullScreenWindowControllerIOS.mm

index e457723..597aa32 100644 (file)
@@ -1,3 +1,17 @@
+2018-01-22  Jon Lee  <jonlee@apple.com>
+
+        Update title label size
+        https://bugs.webkit.org/show_bug.cgi?id=181962
+        rdar://problem/36754744
+
+        Reviewed by Simon Fraser.
+
+        * UIProcess/ios/WKFullScreenWindowControllerIOS.mm:
+        (-[_WKFullScreenViewController setLocation:secure:trustedName:trustedSite:]): Move titleLabel properties into
+        createSubviews.
+        (-[_WKFullScreenViewController createSubviews]): Set the title label for both the cancel and location buttons.
+        Refer to a const CGFloat for the font size.
+
 2018-01-22  Megan Gardner  <megan_gardner@apple.com>
 
         Temporarily restore block selection code conditionally
index 3c06fca..7bccfa8 100644 (file)
@@ -59,6 +59,7 @@ namespace WebKit {
 
 static const NSTimeInterval showHideAnimationDuration = 0.1;
 static const NSTimeInterval autoHideDelay = 4.0;
+static const CGFloat fontSize = 12;
 
 static void replaceViewWithView(UIView *view, UIView *otherView)
 {
@@ -256,8 +257,6 @@ static UIEdgeInsets mirrorEdgeInsets(UIEdgeInsets insets)
     [_locationButton setContentEdgeInsets:locationContentEdgeInsets];
     [_locationButton setImageEdgeInsets:locationImageEdgeInsets];
     [_locationButton setTitle:locationName forState:UIControlStateNormal];
-    [[_locationButton titleLabel] setLineBreakMode:NSLineBreakByTruncatingTail];
-    [[_locationButton titleLabel] setAdjustsFontSizeToFitWidth:NO];
 }
 
 - (void)createSubviews
@@ -274,6 +273,7 @@ static UIEdgeInsets mirrorEdgeInsets(UIEdgeInsets insets)
     [[_cancelButton layer] setCompositingFilter:[CAFilter filterWithType:kCAFilterPlusL]];
     [_cancelButton setTitle:WEB_UI_STRING("Done", "Text of button that exits element fullscreen.") forState:UIControlStateNormal];
     [_cancelButton setTintColor:[UIColor whiteColor]];
+    [[_cancelButton titleLabel] setFont:[UIFont systemFontOfSize:fontSize]];
     [_cancelButton addTarget:self action:@selector(cancelAction:) forControlEvents:UIControlEventTouchUpInside];
 
     [[self view] addSubview:_cancelButton.get()];
@@ -283,6 +283,9 @@ static UIEdgeInsets mirrorEdgeInsets(UIEdgeInsets insets)
     [_locationButton setAdjustsImageWhenHighlighted:NO];
     [_locationButton setBackgroundColor:[UIColor blackColor]];
     [[_locationButton layer] setCompositingFilter:[CAFilter filterWithType:kCAFilterPlusL]];
+    [[_locationButton titleLabel] setLineBreakMode:NSLineBreakByTruncatingTail];
+    [[_locationButton titleLabel] setAdjustsFontSizeToFitWidth:NO];
+    [[_locationButton titleLabel] setFont:[UIFont systemFontOfSize:fontSize]];
     [[self view] addSubview:_locationButton.get()];
 
     UILayoutGuide* containerGuide = [[self view] layoutMarginsGuide];