Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(129)

Side by Side Diff: ash/system/tray/tray_utils.cc

Issue 23228004: Prepare to use gfx::RenderText in views::Label. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert Label implementation changes. Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/sticky_keys/sticky_keys_overlay.cc ('k') | ash/touch/touch_hud_debug.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 label->SetFontList(gfx::FontList().Derive(1, gfx::Font::BOLD)); 16 label->SetFontList(gfx::FontList().Derive(1, gfx::Font::BOLD));
17 label->SetAutoColorReadabilityEnabled(false); 17 label->SetAutoColorReadabilityEnabled(false);
18 label->SetEnabledColor(SK_ColorWHITE); 18 label->SetEnabledColor(SK_ColorWHITE);
19 label->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255)); 19 label->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255));
20 label->set_shadows(gfx::ShadowValues(1, 20 label->SetShadows(gfx::ShadowValues(
21 gfx::ShadowValue(gfx::Point(0, 1), 0, SkColorSetARGB(64, 0, 0, 0)))); 21 1, gfx::ShadowValue(gfx::Point(0, 1), 0, SkColorSetARGB(64, 0, 0, 0))));
22 } 22 }
23 23
24 void SetTrayImageItemBorder(views::View* tray_view, 24 void SetTrayImageItemBorder(views::View* tray_view,
25 ShelfAlignment alignment) { 25 ShelfAlignment alignment) {
26 if (alignment == SHELF_ALIGNMENT_BOTTOM || 26 if (alignment == SHELF_ALIGNMENT_BOTTOM ||
27 alignment == SHELF_ALIGNMENT_TOP) { 27 alignment == SHELF_ALIGNMENT_TOP) {
28 tray_view->SetBorder(views::Border::CreateEmptyBorder( 28 tray_view->SetBorder(views::Border::CreateEmptyBorder(
29 0, 29 0,
30 kTrayImageItemHorizontalPaddingBottomAlignment, 30 kTrayImageItemHorizontalPaddingBottomAlignment,
31 0, 31 0,
(...skipping 23 matching lines...) Expand all
55 tray_view->label()->GetPreferredSize().width()) / 2); 55 tray_view->label()->GetPreferredSize().width()) / 2);
56 tray_view->SetBorder(views::Border::CreateEmptyBorder( 56 tray_view->SetBorder(views::Border::CreateEmptyBorder(
57 kTrayLabelItemVerticalPaddingVerticalAlignment, 57 kTrayLabelItemVerticalPaddingVerticalAlignment,
58 horizontal_padding, 58 horizontal_padding,
59 kTrayLabelItemVerticalPaddingVerticalAlignment, 59 kTrayLabelItemVerticalPaddingVerticalAlignment,
60 horizontal_padding)); 60 horizontal_padding));
61 } 61 }
62 } 62 }
63 63
64 } // namespace ash 64 } // namespace ash
OLDNEW
« no previous file with comments | « ash/sticky_keys/sticky_keys_overlay.cc ('k') | ash/touch/touch_hud_debug.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698