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 }; ...@@ -250,38 +250,32 @@ typedef NS_ENUM(NSInteger, ButtonPositioning) { Leading, Centered, Trailing };
[[button titleLabel] [[button titleLabel]
setFont:[[MDCTypography fontLoader] regularFontOfSize:14]]; setFont:[[MDCTypography fontLoader] regularFontOfSize:14]];
NSTextAlignment textAlignement;
UIControlContentHorizontalAlignment horizontalAlignement; UIControlContentHorizontalAlignment horizontalAlignement;
switch (position) { switch (position) {
case Leading: case Leading:
if (UseRTLLayout()) { if (UseRTLLayout()) {
horizontalAlignement = UIControlContentHorizontalAlignmentRight; horizontalAlignement = UIControlContentHorizontalAlignmentRight;
textAlignement = NSTextAlignmentRight;
} else { } else {
horizontalAlignement = UIControlContentHorizontalAlignmentLeft; horizontalAlignement = UIControlContentHorizontalAlignmentLeft;
textAlignement = NSTextAlignmentLeft;
} }
break; break;
case Centered: case Centered:
horizontalAlignement = UIControlContentHorizontalAlignmentCenter; horizontalAlignement = UIControlContentHorizontalAlignmentCenter;
textAlignement = NSTextAlignmentCenter;
break; break;
case Trailing: case Trailing:
if (UseRTLLayout()) { if (UseRTLLayout()) {
horizontalAlignement = UIControlContentHorizontalAlignmentLeft; horizontalAlignement = UIControlContentHorizontalAlignmentLeft;
textAlignement = NSTextAlignmentLeft;
} else { } else {
horizontalAlignement = UIControlContentHorizontalAlignmentRight; horizontalAlignement = UIControlContentHorizontalAlignmentRight;
textAlignement = NSTextAlignmentRight;
} }
break; break;
} }
button.contentHorizontalAlignment = horizontalAlignement; button.contentHorizontalAlignment = horizontalAlignement;
button.titleLabel.textAlignment = textAlignement; button.titleLabel.textAlignment = NSTextAlignmentCenter;
return button; 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