| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/hover_highlight_view.h" | 5 #include "ash/system/tray/hover_highlight_view.h" |
| 6 | 6 |
| 7 #include "ash/system/tray/fixed_sized_image_view.h" | 7 #include "ash/system/tray/fixed_sized_image_view.h" |
| 8 #include "ash/system/tray/tray_constants.h" | 8 #include "ash/system/tray/tray_constants.h" |
| 9 #include "ash/system/tray/view_click_listener.h" | 9 #include "ash/system/tray/view_click_listener.h" |
| 10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 70 SetLayoutManager(new views::FillLayout()); | 70 SetLayoutManager(new views::FillLayout()); |
| 71 text_label_ = new views::Label(text); | 71 text_label_ = new views::Label(text); |
| 72 int margin = kTrayPopupPaddingHorizontal + | 72 int margin = kTrayPopupPaddingHorizontal + |
| 73 kTrayPopupDetailsLabelExtraLeftMargin; | 73 kTrayPopupDetailsLabelExtraLeftMargin; |
| 74 int left_margin = 0; | 74 int left_margin = 0; |
| 75 int right_margin = 0; | 75 int right_margin = 0; |
| 76 if (base::i18n::IsRTL()) | 76 if (base::i18n::IsRTL()) |
| 77 right_margin = margin; | 77 right_margin = margin; |
| 78 else | 78 else |
| 79 left_margin = margin; | 79 left_margin = margin; |
| 80 text_label_->set_border( | 80 text_label_->SetBorder( |
| 81 views::Border::CreateEmptyBorder(5, left_margin, 5, right_margin)); | 81 views::Border::CreateEmptyBorder(5, left_margin, 5, right_margin)); |
| 82 text_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 82 text_label_->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
| 83 text_label_->SetFontList( | 83 text_label_->SetFontList( |
| 84 text_label_->font_list().DeriveFontListWithSizeDeltaAndStyle(0, style)); | 84 text_label_->font_list().DeriveFontListWithSizeDeltaAndStyle(0, style)); |
| 85 // Do not set alpha value in disable color. It will have issue with elide | 85 // Do not set alpha value in disable color. It will have issue with elide |
| 86 // blending filter in disabled state for rendering label text color. | 86 // blending filter in disabled state for rendering label text color. |
| 87 text_label_->SetDisabledColor(SkColorSetARGB(255, 127, 127, 127)); | 87 text_label_->SetDisabledColor(SkColorSetARGB(255, 127, 127, 127)); |
| 88 if (text_default_color_) | 88 if (text_default_color_) |
| 89 text_label_->SetEnabledColor(text_default_color_); | 89 text_label_->SetEnabledColor(text_default_color_); |
| 90 AddChildView(text_label_); | 90 AddChildView(text_label_); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 canvas->DrawColor(hover_ ? highlight_color_ : default_color_); | 183 canvas->DrawColor(hover_ ? highlight_color_ : default_color_); |
| 184 } | 184 } |
| 185 | 185 |
| 186 void HoverHighlightView::OnFocus() { | 186 void HoverHighlightView::OnFocus() { |
| 187 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); | 187 ScrollRectToVisible(gfx::Rect(gfx::Point(), size())); |
| 188 ActionableView::OnFocus(); | 188 ActionableView::OnFocus(); |
| 189 } | 189 } |
| 190 | 190 |
| 191 } // namespace internal | 191 } // namespace internal |
| 192 } // namespace ash | 192 } // namespace ash |
| OLD | NEW |