| 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_utils.h" | 5 #include "ash/system/tray/tray_utils.h" |
| 6 | 6 |
| 7 #include "ash/system/tray/tray_constants.h" | 7 #include "ash/system/tray/tray_constants.h" |
| 8 #include "ash/system/tray/tray_item_view.h" | 8 #include "ash/system/tray/tray_item_view.h" |
| 9 #include "ui/gfx/font_list.h" | 9 #include "ui/gfx/font_list.h" |
| 10 #include "ui/views/border.h" | 10 #include "ui/views/border.h" |
| 11 #include "ui/views/controls/label.h" | 11 #include "ui/views/controls/label.h" |
| 12 | 12 |
| 13 namespace ash { | 13 namespace ash { |
| 14 | 14 |
| 15 void SetupLabelForTray(views::Label* label) { | 15 void SetupLabelForTray(views::Label* label) { |
| 16 // Making label_font static to avoid the time penalty of Derive for all but | 16 label->SetFontList(gfx::FontList().Derive(1, gfx::Font::BOLD)); |
| 17 // the first call. | |
| 18 static const gfx::FontList label_font_list( | |
| 19 gfx::FontList().Derive(1, gfx::Font::BOLD)); | |
| 20 label->SetFontList(label_font_list); | |
| 21 label->SetAutoColorReadabilityEnabled(false); | 17 label->SetAutoColorReadabilityEnabled(false); |
| 22 label->SetEnabledColor(SK_ColorWHITE); | 18 label->SetEnabledColor(SK_ColorWHITE); |
| 23 label->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255)); | 19 label->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255)); |
| 24 label->SetShadowColors(SkColorSetARGB(64, 0, 0, 0), | 20 label->set_shadows(gfx::ShadowValues(1, |
| 25 SkColorSetARGB(64, 0, 0, 0)); | 21 gfx::ShadowValue(gfx::Point(0, 1), 0, SkColorSetARGB(64, 0, 0, 0)))); |
| 26 label->SetShadowOffset(0, 1); | |
| 27 } | 22 } |
| 28 | 23 |
| 29 void SetTrayImageItemBorder(views::View* tray_view, | 24 void SetTrayImageItemBorder(views::View* tray_view, |
| 30 ShelfAlignment alignment) { | 25 ShelfAlignment alignment) { |
| 31 if (alignment == SHELF_ALIGNMENT_BOTTOM || | 26 if (alignment == SHELF_ALIGNMENT_BOTTOM || |
| 32 alignment == SHELF_ALIGNMENT_TOP) { | 27 alignment == SHELF_ALIGNMENT_TOP) { |
| 33 tray_view->SetBorder(views::Border::CreateEmptyBorder( | 28 tray_view->SetBorder(views::Border::CreateEmptyBorder( |
| 34 0, | 29 0, |
| 35 kTrayImageItemHorizontalPaddingBottomAlignment, | 30 kTrayImageItemHorizontalPaddingBottomAlignment, |
| 36 0, | 31 0, |
| (...skipping 23 matching lines...) Expand all Loading... |
| 60 tray_view->label()->GetPreferredSize().width()) / 2); | 55 tray_view->label()->GetPreferredSize().width()) / 2); |
| 61 tray_view->SetBorder(views::Border::CreateEmptyBorder( | 56 tray_view->SetBorder(views::Border::CreateEmptyBorder( |
| 62 kTrayLabelItemVerticalPaddingVerticalAlignment, | 57 kTrayLabelItemVerticalPaddingVerticalAlignment, |
| 63 horizontal_padding, | 58 horizontal_padding, |
| 64 kTrayLabelItemVerticalPaddingVerticalAlignment, | 59 kTrayLabelItemVerticalPaddingVerticalAlignment, |
| 65 horizontal_padding)); | 60 horizontal_padding)); |
| 66 } | 61 } |
| 67 } | 62 } |
| 68 | 63 |
| 69 } // namespace ash | 64 } // namespace ash |
| OLD | NEW |