Commit 96f5ccc3 authored by Quan Nguyen's avatar Quan Nguyen Committed by Commit Bot

cros: Fix long emails messing up Remove User button placement

The email label now uses the same layout rule as the user name label, which
fixes the same bug, but for long emails rather than long user names.

Bug: 902362
Change-Id: Icfde3129078ffd6a5977b388210bf2773e0ee405
Reviewed-on: https://chromium-review.googlesource.com/c/1334827
Commit-Queue: Quan Nguyen <qnnguyen@chromium.org>
Reviewed-by: default avatarJacob Dufault <jdufault@chromium.org>
Cr-Commit-Position: refs/heads/master@{#607864}
parent b6aac239
......@@ -243,8 +243,12 @@ class LoginUserMenuView : public LoginBaseBubbleView,
username_label_->SetMaxLines(1);
container->AddChildView(username_label_);
add_space(container, kBubbleBetweenChildSpacingDp);
container->AddChildView(CreateLabel(
email, SkColorSetA(SK_ColorWHITE, kSubMessageColorAlpha)));
views::Label* email_label =
CreateLabel(email, SkColorSetA(SK_ColorWHITE, kSubMessageColorAlpha));
// Do not change these two lines for the same reasons as above.
email_label->SetMultiLine(true);
email_label->SetMaxLines(1);
container->AddChildView(email_label);
}
// Remove user.
......
......@@ -427,14 +427,14 @@ TEST_F(LoginBubbleTest, TestShowSelectionMenu) {
EXPECT_FALSE(bubble_->IsVisible());
}
TEST_F(LoginBubbleTest, LongUserNameLaidOutCorrectly) {
TEST_F(LoginBubbleTest, LongUserNameAndEmailLaidOutCorrectly) {
ui::test::EventGenerator* generator = GetEventGenerator();
EXPECT_FALSE(bubble_->IsVisible());
bubble_->ShowUserMenu(
base::UTF8ToUTF16("NedHasAReallyLongName StarkHasAReallyLongName"),
base::UTF8ToUTF16("reallylonggaianame@gmail.com"),
base::UTF8ToUTF16("reallyreallyextralonggaianame@gmail.com"),
user_manager::UserType::USER_TYPE_REGULAR, false /*is_owner*/, container_,
bubble_opener_, true /*show_remove_user*/, base::OnceClosure(),
base::OnceClosure());
......
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