Commit 1de09a31 authored by Tommy Steimel's avatar Tommy Steimel Committed by Commit Bot

GMC: Ensure left-alignment of title and artist labels

This CL adds horizontal alignment to the title and artist labels to
ensure that they stay properly aligned to the left. This fixes a bug
where overflowing text would shift slightly to the right.

Bug: 1021589
Change-Id: I7c007f4d7af4abe1556941b901a57569dcc41f30
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1899089
Auto-Submit: Tommy Steimel <steimel@chromium.org>
Reviewed-by: default avatarJazz Xu <jazzhsu@chromium.org>
Commit-Queue: Tommy Steimel <steimel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#712663}
parent 185eff22
...@@ -157,12 +157,14 @@ MediaNotificationView::MediaNotificationView( ...@@ -157,12 +157,14 @@ MediaNotificationView::MediaNotificationView(
title_label->SetFontList(base_font_list.Derive( title_label->SetFontList(base_font_list.Derive(
0, gfx::Font::FontStyle::NORMAL, gfx::Font::Weight::MEDIUM)); 0, gfx::Font::FontStyle::NORMAL, gfx::Font::Weight::MEDIUM));
title_label->SetLineHeight(kTitleArtistLineHeight); title_label->SetLineHeight(kTitleArtistLineHeight);
title_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
title_label_ = title_artist_row_->AddChildView(std::move(title_label)); title_label_ = title_artist_row_->AddChildView(std::move(title_label));
auto artist_label = std::make_unique<views::Label>( auto artist_label = std::make_unique<views::Label>(
base::string16(), views::style::CONTEXT_LABEL, base::string16(), views::style::CONTEXT_LABEL,
views::style::STYLE_PRIMARY); views::style::STYLE_PRIMARY);
artist_label->SetLineHeight(kTitleArtistLineHeight); artist_label->SetLineHeight(kTitleArtistLineHeight);
artist_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
artist_label_ = title_artist_row_->AddChildView(std::move(artist_label)); artist_label_ = title_artist_row_->AddChildView(std::move(artist_label));
// |button_row_| contains the buttons for controlling playback. // |button_row_| contains the buttons for controlling playback.
......
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