Commit 2653dd04 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

Use MDC font for toolbar tab count

Bug: 798517
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: Ie796750577450174de605f356ceaa09573952012
Reviewed-on: https://chromium-review.googlesource.com/849835Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526948}
parent 73857d9f
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#import "ios/chrome/common/material_timing.h" #import "ios/chrome/common/material_timing.h"
#include "ios/chrome/grit/ios_theme_resources.h" #include "ios/chrome/grit/ios_theme_resources.h"
#import "ios/third_party/material_components_ios/src/components/ProgressView/src/MaterialProgressView.h" #import "ios/third_party/material_components_ios/src/components/ProgressView/src/MaterialProgressView.h"
#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
#if !defined(__has_feature) || !__has_feature(objc_arc) #if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support." #error "This file requires ARC support."
...@@ -486,6 +487,7 @@ ...@@ -486,6 +487,7 @@
// accessibility value will always be equal to |tabCount|. // accessibility value will always be equal to |tabCount|.
NSString* tabStripButtonValue = [NSString stringWithFormat:@"%d", tabCount]; NSString* tabStripButtonValue = [NSString stringWithFormat:@"%d", tabCount];
NSString* tabStripButtonTitle; NSString* tabStripButtonTitle;
id<MDCTypographyFontLoading> fontLoader = [MDCTypography fontLoader];
if (tabCount <= 0) { if (tabCount <= 0) {
tabStripButtonTitle = @""; tabStripButtonTitle = @"";
} else if (tabCount > kShowTabStripButtonMaxTabCount) { } else if (tabCount > kShowTabStripButtonMaxTabCount) {
...@@ -493,15 +495,15 @@ ...@@ -493,15 +495,15 @@
// more than 99 tabs open. // more than 99 tabs open.
tabStripButtonTitle = @":)"; tabStripButtonTitle = @":)";
[[self.view.tabSwitchStripButton titleLabel] [[self.view.tabSwitchStripButton titleLabel]
setFont:[UIFont boldSystemFontOfSize:kFontSizeFewerThanTenTabs]]; setFont:[fontLoader boldFontOfSize:kFontSizeFewerThanTenTabs]];
} else { } else {
tabStripButtonTitle = tabStripButtonValue; tabStripButtonTitle = tabStripButtonValue;
if (tabCount < 10) { if (tabCount < 10) {
[[self.view.tabSwitchStripButton titleLabel] [[self.view.tabSwitchStripButton titleLabel]
setFont:[UIFont boldSystemFontOfSize:kFontSizeFewerThanTenTabs]]; setFont:[fontLoader boldFontOfSize:kFontSizeFewerThanTenTabs]];
} else { } else {
[[self.view.tabSwitchStripButton titleLabel] [[self.view.tabSwitchStripButton titleLabel]
setFont:[UIFont boldSystemFontOfSize:kFontSizeTenTabsOrMore]]; setFont:[fontLoader boldFontOfSize:kFontSizeTenTabsOrMore]];
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment