Chromium Code Reviews| Index: ash/system/tray/hover_highlight_view.cc |
| diff --git a/ash/system/tray/hover_highlight_view.cc b/ash/system/tray/hover_highlight_view.cc |
| index bc8f017ab7aa3b98c92129696ed0f113014f92cb..04b0c33528cbb2fb5246ecab6ec77beb722fedae 100644 |
| --- a/ash/system/tray/hover_highlight_view.cc |
| +++ b/ash/system/tray/hover_highlight_view.cc |
| @@ -65,20 +65,21 @@ void HoverHighlightView::AddIconAndLabel(const gfx::ImageSkia& image, |
| } |
| views::Label* HoverHighlightView::AddLabel(const base::string16& text, |
| + gfx::HorizontalAlignment alignment, |
| gfx::Font::FontStyle style) { |
| SetLayoutManager(new views::FillLayout()); |
| text_label_ = new views::Label(text); |
| - int margin = kTrayPopupPaddingHorizontal + |
| - kTrayPopupDetailsLabelExtraLeftMargin; |
| - int left_margin = 0; |
| - int right_margin = 0; |
| - if (base::i18n::IsRTL()) |
| - right_margin = margin; |
| - else |
| - left_margin = margin; |
| + int left_margin = kTrayPopupPaddingHorizontal; |
| + int right_margin = kTrayPopupPaddingHorizontal; |
| + if (alignment != gfx::ALIGN_CENTER) { |
|
Mr4D (OOO till 08-26)
2014/03/25 23:54:13
Looking at this I think you imply which alignments
dzhioev (left Google)
2014/03/26 13:29:22
Actually any alignment is allowed now. There was p
Mr4D (OOO till 08-26)
2014/03/26 16:49:53
In that case: Shouldn't the two cases below then d
dzhioev (left Google)
2014/03/26 23:48:52
For ALIGN_LEFT we add kTrayPopupDetailsLabelExtraL
|
| + if (base::i18n::IsRTL()) |
| + right_margin += kTrayPopupDetailsLabelExtraLeftMargin; |
| + else |
| + left_margin += kTrayPopupDetailsLabelExtraLeftMargin; |
| + } |
| text_label_->SetBorder( |
| views::Border::CreateEmptyBorder(5, left_margin, 5, right_margin)); |
| - text_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| + text_label_->SetHorizontalAlignment(alignment); |
| text_label_->SetFontList(text_label_->font_list().DeriveWithStyle(style)); |
| // Do not set alpha value in disable color. It will have issue with elide |
| // blending filter in disabled state for rendering label text color. |
| @@ -120,7 +121,7 @@ views::Label* HoverHighlightView::AddCheckableLabel(const base::string16& text, |
| SetAccessibleName(text); |
| return text_label_; |
| } |
| - return AddLabel(text, style); |
| + return AddLabel(text, gfx::ALIGN_LEFT, style); |
| } |
| void HoverHighlightView::SetExpandable(bool expandable) { |