Commit 6edea0df authored by gambard's avatar gambard Committed by Commit bot

Align the text in ReadingList buttons at center

BUG=676820

Review-Url: https://codereview.chromium.org/2616933004
Cr-Commit-Position: refs/heads/master@{#441930}
parent 114c62b9
......@@ -250,38 +250,32 @@ typedef NS_ENUM(NSInteger, ButtonPositioning) { Leading, Centered, Trailing };
[[button titleLabel]
setFont:[[MDCTypography fontLoader] regularFontOfSize:14]];
NSTextAlignment textAlignement;
UIControlContentHorizontalAlignment horizontalAlignement;
switch (position) {
case Leading:
if (UseRTLLayout()) {
horizontalAlignement = UIControlContentHorizontalAlignmentRight;
textAlignement = NSTextAlignmentRight;
} else {
horizontalAlignement = UIControlContentHorizontalAlignmentLeft;
textAlignement = NSTextAlignmentLeft;
}
break;
case Centered:
horizontalAlignement = UIControlContentHorizontalAlignmentCenter;
textAlignement = NSTextAlignmentCenter;
break;
case Trailing:
if (UseRTLLayout()) {
horizontalAlignement = UIControlContentHorizontalAlignmentLeft;
textAlignement = NSTextAlignmentLeft;
} else {
horizontalAlignement = UIControlContentHorizontalAlignmentRight;
textAlignement = NSTextAlignmentRight;
}
break;
}
button.contentHorizontalAlignment = horizontalAlignement;
button.titleLabel.textAlignment = textAlignement;
button.titleLabel.textAlignment = NSTextAlignmentCenter;
return button;
}
......
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