OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/system/tray/tray_views.h" | 5 #include "ash/system/tray/tray_views.h" |
6 | 6 |
7 #include "ash/ash_constants.h" | 7 #include "ash/ash_constants.h" |
8 #include "ash/system/tray/tray_constants.h" | 8 #include "ash/system/tray/tray_constants.h" |
9 #include "ash/system/tray/tray_item_view.h" | 9 #include "ash/system/tray/tray_item_view.h" |
10 #include "grit/ash_resources.h" | 10 #include "grit/ash_resources.h" |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 text_label_ = new views::Label(text); | 208 text_label_ = new views::Label(text); |
209 int margin = kTrayPopupPaddingHorizontal + kPopupDetailLabelExtraLeftMargin; | 209 int margin = kTrayPopupPaddingHorizontal + kPopupDetailLabelExtraLeftMargin; |
210 int left_margin = 0; | 210 int left_margin = 0; |
211 int right_margin = 0; | 211 int right_margin = 0; |
212 if (base::i18n::IsRTL()) | 212 if (base::i18n::IsRTL()) |
213 right_margin = margin; | 213 right_margin = margin; |
214 else | 214 else |
215 left_margin = margin; | 215 left_margin = margin; |
216 text_label_->set_border( | 216 text_label_->set_border( |
217 views::Border::CreateEmptyBorder(5, left_margin, 5, right_margin)); | 217 views::Border::CreateEmptyBorder(5, left_margin, 5, right_margin)); |
218 text_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 218 text_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
219 text_label_->SetFont(text_label_->font().DeriveFont(0, style)); | 219 text_label_->SetFont(text_label_->font().DeriveFont(0, style)); |
220 text_label_->SetDisabledColor(SkColorSetARGB(127, 0, 0, 0)); | 220 text_label_->SetDisabledColor(SkColorSetARGB(127, 0, 0, 0)); |
221 if (text_default_color_) | 221 if (text_default_color_) |
222 text_label_->SetEnabledColor(text_default_color_); | 222 text_label_->SetEnabledColor(text_default_color_); |
223 AddChildView(text_label_); | 223 AddChildView(text_label_); |
224 | 224 |
225 SetAccessibleName(text); | 225 SetAccessibleName(text); |
226 } | 226 } |
227 | 227 |
228 void HoverHighlightView::AddCheckableLabel(const string16& text, | 228 void HoverHighlightView::AddCheckableLabel(const string16& text, |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
707 tray_view->set_border(views::Border::CreateEmptyBorder( | 707 tray_view->set_border(views::Border::CreateEmptyBorder( |
708 kTrayLabelItemVerticalPaddingVeriticalAlignment, | 708 kTrayLabelItemVerticalPaddingVeriticalAlignment, |
709 horizontal_padding, | 709 horizontal_padding, |
710 kTrayLabelItemVerticalPaddingVeriticalAlignment, | 710 kTrayLabelItemVerticalPaddingVeriticalAlignment, |
711 horizontal_padding)); | 711 horizontal_padding)); |
712 } | 712 } |
713 } | 713 } |
714 | 714 |
715 } // namespace internal | 715 } // namespace internal |
716 } // namespace ash | 716 } // namespace ash |
OLD | NEW |