Commit 0f572485 authored by Siyu An's avatar Siyu An Committed by Commit Bot

[Nickname Management] Wrap long card identifier in migration dialog

Here in the migration dialog the expiration date has the format:
"Exp: 06/21" so it may lead to different length when translated.
So here to be safe I just limited the label width directly, and
hopefully will leave enough space for expiration date.

Uploaded screenshot in bug comment #32

Bug: 1082013
Change-Id: I63759412571ac4f163dee779bd3eb98e83952de3
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2241647Reviewed-by: default avatarDana Fried <dfried@chromium.org>
Reviewed-by: default avatarJared Saul <jsaul@google.com>
Commit-Queue: Siyu An <siyua@chromium.org>
Cr-Commit-Position: refs/heads/master@{#779933}
parent 8e4ff348
...@@ -103,6 +103,10 @@ MigratableCardView::GetMigratableCardDescriptionView( ...@@ -103,6 +103,10 @@ MigratableCardView::GetMigratableCardDescriptionView(
std::unique_ptr<views::Label> card_description = std::unique_ptr<views::Label> card_description =
std::make_unique<views::Label>(GetCardIdentifierString(), std::make_unique<views::Label>(GetCardIdentifierString(),
views::style::CONTEXT_LABEL); views::style::CONTEXT_LABEL);
card_description->SetMultiLine(true);
card_description->SetHorizontalAlignment(gfx::ALIGN_LEFT);
constexpr int kCardDescriptionMaximumWidth = 260;
card_description->SetMaximumWidth(kCardDescriptionMaximumWidth);
constexpr int kMigrationResultImageSize = 16; constexpr int kMigrationResultImageSize = 16;
switch (migratable_credit_card.migration_status()) { switch (migratable_credit_card.migration_status()) {
...@@ -165,6 +169,8 @@ MigratableCardView::GetMigratableCardDescriptionView( ...@@ -165,6 +169,8 @@ MigratableCardView::GetMigratableCardDescriptionView(
migratable_credit_card.credit_card() migratable_credit_card.credit_card()
.AbbreviatedExpirationDateForDisplay(/*with_prefix=*/true), .AbbreviatedExpirationDateForDisplay(/*with_prefix=*/true),
views::style::CONTEXT_LABEL, views::style::STYLE_SECONDARY); views::style::CONTEXT_LABEL, views::style::STYLE_SECONDARY);
card_expiration->SetElideBehavior(gfx::ElideBehavior::NO_ELIDE);
card_expiration->SetMultiLine(true);
migratable_card_description_view->AddChildView(card_expiration.release()); migratable_card_description_view->AddChildView(card_expiration.release());
// If card is not successfully uploaded we show the invalid card // If card is not successfully uploaded we show the invalid card
......
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