diff options
-rw-r--r-- | ash/system/date/tray_date.cc | 7 | ||||
-rw-r--r-- | ash/system/ime/tray_ime.cc | 6 | ||||
-rw-r--r-- | ash/system/tray/tray_views.cc | 8 | ||||
-rw-r--r-- | ash/system/tray/tray_views.h | 7 |
4 files changed, 19 insertions, 9 deletions
diff --git a/ash/system/date/tray_date.cc b/ash/system/date/tray_date.cc index 97bfa7c..b7454dc 100644 --- a/ash/system/date/tray_date.cc +++ b/ash/system/date/tray_date.cc @@ -8,6 +8,7 @@ #include "ash/system/date/date_view.h" #include "ash/system/tray/system_tray_delegate.h" #include "ash/system/tray/tray_constants.h" +#include "ash/system/tray/tray_views.h" #include "base/i18n/time_formatting.h" #include "base/stringprintf.h" #include "base/time.h" @@ -42,11 +43,7 @@ TrayDate::~TrayDate() { views::View* TrayDate::CreateTrayView(user::LoginStatus status) { date_tray_.reset(new tray::DateView(tray::DateView::TIME)); - date_tray_->label()->SetFont( - date_tray_->label()->font().DeriveFont(2, gfx::Font::BOLD)); - date_tray_->label()->SetAutoColorReadabilityEnabled(false); - date_tray_->label()->SetEnabledColor(SK_ColorWHITE); - + SetupLabelForTray(date_tray_->label()); return date_tray_.get(); } diff --git a/ash/system/ime/tray_ime.cc b/ash/system/ime/tray_ime.cc index 6561676..b3694b2 100644 --- a/ash/system/ime/tray_ime.cc +++ b/ash/system/ime/tray_ime.cc @@ -8,6 +8,7 @@ #include "ash/shell.h" #include "ash/system/tray/system_tray_delegate.h" +#include "ash/system/tray/tray_views.h" #include "base/logging.h" #include "base/utf_string_conversions.h" #include "ui/gfx/font.h" @@ -36,10 +37,7 @@ void TrayIME::UpdateTrayLabel() { views::View* TrayIME::CreateTrayView(user::LoginStatus status) { tray_label_.reset(new views::Label); - tray_label_->SetFont( - tray_label_->font().DeriveFont(2, gfx::Font::BOLD)); - tray_label_->SetAutoColorReadabilityEnabled(false); - tray_label_->SetEnabledColor(SK_ColorWHITE); + SetupLabelForTray(tray_label_.get()); return tray_label_.get(); } diff --git a/ash/system/tray/tray_views.cc b/ash/system/tray/tray_views.cc index 9e84c10..73f856f 100644 --- a/ash/system/tray/tray_views.cc +++ b/ash/system/tray/tray_views.cc @@ -85,5 +85,13 @@ void HoverHighlightView::OnMouseExited(const views::MouseEvent& event) { SchedulePaint(); } +void SetupLabelForTray(views::Label* label) { + label->SetFont( + label->font().DeriveFont(2, gfx::Font::BOLD)); + label->SetAutoColorReadabilityEnabled(false); + label->SetEnabledColor(SK_ColorWHITE); + label->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255)); +} + } // namespace internal } // namespace ash diff --git a/ash/system/tray/tray_views.h b/ash/system/tray/tray_views.h index 4ba0597..bf0267a 100644 --- a/ash/system/tray/tray_views.h +++ b/ash/system/tray/tray_views.h @@ -13,6 +13,10 @@ class SkBitmap; +namespace views { +class Label; +} + namespace ash { namespace internal { @@ -61,6 +65,9 @@ class HoverHighlightView : public views::View { DISALLOW_COPY_AND_ASSIGN(HoverHighlightView); }; +// Sets up a Label properly for the tray (sets color, font etc.). +void SetupLabelForTray(views::Label* label); + } // namespace internal } // namespace ash |