Commit 763ccf93 authored by sadrul@chromium.org's avatar sadrul@chromium.org

ash: Make sure the text-label entries in the tray look consistently good.

BUG=119441
TEST=none

Review URL: https://chromiumcodereview.appspot.com/9834003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@128211 0039d316-1c4b-4281-b951-d872f2087c98
parent 4f8f6660
......@@ -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();
}
......
......@@ -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();
}
......
......@@ -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
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment