| 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 "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 691 container_bounds.ClampToCenteredSize(bounds.size()); | 691 container_bounds.ClampToCenteredSize(bounds.size()); |
| 692 container_bounds.set_x(content_bounds.width() - container_bounds.width()); | 692 container_bounds.set_x(content_bounds.width() - container_bounds.width()); |
| 693 button_container_->SetBoundsRect(container_bounds); | 693 button_container_->SetBoundsRect(container_bounds); |
| 694 | 694 |
| 695 bounds = content_->bounds(); | 695 bounds = content_->bounds(); |
| 696 bounds.set_width(button_container_->x()); | 696 bounds.set_width(button_container_->x()); |
| 697 content_->SetBoundsRect(bounds); | 697 content_->SetBoundsRect(bounds); |
| 698 } | 698 } |
| 699 | 699 |
| 700 void SetupLabelForTray(views::Label* label) { | 700 void SetupLabelForTray(views::Label* label) { |
| 701 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 701 // Making label_font static to avoid the time penalty of DeriveFont for |
| 702 label->SetFont(rb.GetFont(ui::ResourceBundle::BoldFont)); | 702 // all but the first call. |
| 703 static const gfx::Font label_font(gfx::Font().DeriveFont(1, gfx::Font::BOLD)); |
| 704 label->SetFont(label_font); |
| 703 label->SetAutoColorReadabilityEnabled(false); | 705 label->SetAutoColorReadabilityEnabled(false); |
| 704 label->SetEnabledColor(SK_ColorWHITE); | 706 label->SetEnabledColor(SK_ColorWHITE); |
| 705 label->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255)); | 707 label->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255)); |
| 706 label->SetShadowColors(SkColorSetARGB(64, 0, 0, 0), | 708 label->SetShadowColors(SkColorSetARGB(64, 0, 0, 0), |
| 707 SkColorSetARGB(64, 0, 0, 0)); | 709 SkColorSetARGB(64, 0, 0, 0)); |
| 708 label->SetShadowOffset(0, 1); | 710 label->SetShadowOffset(0, 1); |
| 709 } | 711 } |
| 710 | 712 |
| 711 void SetTrayImageItemBorder(views::View* tray_view, | 713 void SetTrayImageItemBorder(views::View* tray_view, |
| 712 ShelfAlignment alignment) { | 714 ShelfAlignment alignment) { |
| (...skipping 25 matching lines...) Expand all Loading... |
| 738 tray_view->set_border(views::Border::CreateEmptyBorder( | 740 tray_view->set_border(views::Border::CreateEmptyBorder( |
| 739 kTrayLabelItemVerticalPaddingVeriticalAlignment, | 741 kTrayLabelItemVerticalPaddingVeriticalAlignment, |
| 740 horizontal_padding, | 742 horizontal_padding, |
| 741 kTrayLabelItemVerticalPaddingVeriticalAlignment, | 743 kTrayLabelItemVerticalPaddingVeriticalAlignment, |
| 742 horizontal_padding)); | 744 horizontal_padding)); |
| 743 } | 745 } |
| 744 } | 746 } |
| 745 | 747 |
| 746 } // namespace internal | 748 } // namespace internal |
| 747 } // namespace ash | 749 } // namespace ash |
| OLD | NEW |