Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(308)

Unified Diff: ash/system/tray/hover_highlight_view.cc

Issue 210903003: Implemented system tray UI for new account management. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More comments addressed. Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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) {
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698