Commit b17acb28 authored by Jérôme Lebel's avatar Jérôme Lebel Committed by Commit Bot

[iOS][Signin] Fixing font issues on the MDCButton

With a MDCButton, the font should not be set on the title label, but on the
button itself, using:
-[MDCButton setTitleFont:forState:]

Bug: 803767
Cq-Include-Trybots: master.tryserver.chromium.mac:ios-simulator-cronet;master.tryserver.chromium.mac:ios-simulator-full-configs
Change-Id: I4232f2d080daca4e8fc2e585d51c24c1b10ab1ac
Reviewed-on: https://chromium-review.googlesource.com/891221Reviewed-by: default avatarKurt Horimoto <kkhorimoto@chromium.org>
Commit-Queue: Jérôme Lebel <jlebel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533067}
parent fa6df250
......@@ -840,10 +840,10 @@ enum AuthenticationState {
}
- (void)layoutButtons:(const AuthenticationViewConstants&)constants {
[_primaryButton titleLabel].font =
[[MDCTypography fontLoader] mediumFontOfSize:constants.SecondaryFontSize];
[_secondaryButton titleLabel].font =
UIFont* font =
[[MDCTypography fontLoader] mediumFontOfSize:constants.SecondaryFontSize];
[_primaryButton setTitleFont:font forState:UIControlStateNormal];
[_secondaryButton setTitleFont:font forState:UIControlStateNormal];
LayoutRect primaryButtonLayout = LayoutRectZero;
primaryButtonLayout.boundingWidth = CGRectGetWidth(self.view.bounds);
......
......@@ -555,8 +555,9 @@ const char kPrivacyNoticeUrl[] = "internal://privacy-notice";
}
- (void)configureOKButton {
self.OKButton.titleLabel.font = [[MDCTypography fontLoader]
UIFont* font = [[MDCTypography fontLoader]
mediumFontOfSize:kOKButtonTitleLabelFontSize[self.cr_widthSizeClass]];
[self.OKButton setTitleFont:font forState:UIControlStateNormal];
CGSize size = [self.OKButton
sizeThatFits:CGSizeMake(CGFLOAT_MAX,
kOKButtonHeight[self.cr_widthSizeClass])];
......
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