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

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

Issue 2390003002: [Chrome OS MD] Update spacing between material design icons in the system tray (Closed)
Patch Set: Created 4 years, 2 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
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/common/system/tray/tray_utils.h" 5 #include "ash/common/system/tray/tray_utils.h"
6 6
7 #include "ash/common/material_design/material_design_controller.h" 7 #include "ash/common/material_design/material_design_controller.h"
8 #include "ash/common/shelf/wm_shelf_util.h" 8 #include "ash/common/shelf/wm_shelf_util.h"
9 #include "ash/common/system/tray/tray_constants.h" 9 #include "ash/common/system/tray/tray_constants.h"
10 #include "ash/common/system/tray/tray_item_view.h" 10 #include "ash/common/system/tray/tray_item_view.h"
(...skipping 18 matching lines...) Expand all
29 label->SetShadows(gfx::ShadowValues( 29 label->SetShadows(gfx::ShadowValues(
30 1, 30 1,
31 gfx::ShadowValue(gfx::Vector2d(0, 1), 0, SkColorSetARGB(64, 0, 0, 0)))); 31 gfx::ShadowValue(gfx::Vector2d(0, 1), 0, SkColorSetARGB(64, 0, 0, 0))));
32 label->SetAutoColorReadabilityEnabled(false); 32 label->SetAutoColorReadabilityEnabled(false);
33 label->SetEnabledColor(SK_ColorWHITE); 33 label->SetEnabledColor(SK_ColorWHITE);
34 label->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255)); 34 label->SetBackgroundColor(SkColorSetARGB(0, 255, 255, 255));
35 } 35 }
36 } 36 }
37 37
38 void SetTrayImageItemBorder(views::View* tray_view, ShelfAlignment alignment) { 38 void SetTrayImageItemBorder(views::View* tray_view, ShelfAlignment alignment) {
39 const int tray_image_item_padding = GetTrayConstant(TRAY_IMAGE_ITEM_PADDING);
39 if (IsHorizontalAlignment(alignment)) { 40 if (IsHorizontalAlignment(alignment)) {
40 tray_view->SetBorder(views::Border::CreateEmptyBorder( 41 tray_view->SetBorder(views::Border::CreateEmptyBorder(
41 0, kTrayImageItemHorizontalPaddingBottomAlignment, 0, 42 0, tray_image_item_padding, 0, tray_image_item_padding));
42 kTrayImageItemHorizontalPaddingBottomAlignment));
43 } else { 43 } else {
44 tray_view->SetBorder(views::Border::CreateEmptyBorder( 44 tray_view->SetBorder(views::Border::CreateEmptyBorder(
45 kTrayImageItemVerticalPaddingVerticalAlignment, 45 tray_image_item_padding,
46 kTrayImageItemHorizontalPaddingVerticalAlignment, 46 kTrayImageItemHorizontalPaddingVerticalAlignment,
47 kTrayImageItemVerticalPaddingVerticalAlignment, 47 tray_image_item_padding,
48 kTrayImageItemHorizontalPaddingVerticalAlignment)); 48 kTrayImageItemHorizontalPaddingVerticalAlignment));
49 } 49 }
50 } 50 }
51 51
52 void SetTrayLabelItemBorder(TrayItemView* tray_view, ShelfAlignment alignment) { 52 void SetTrayLabelItemBorder(TrayItemView* tray_view, ShelfAlignment alignment) {
53 if (IsHorizontalAlignment(alignment)) { 53 if (IsHorizontalAlignment(alignment)) {
54 tray_view->SetBorder(views::Border::CreateEmptyBorder( 54 tray_view->SetBorder(views::Border::CreateEmptyBorder(
55 0, kTrayLabelItemHorizontalPaddingBottomAlignment, 0, 55 0, kTrayLabelItemHorizontalPaddingBottomAlignment, 0,
56 kTrayLabelItemHorizontalPaddingBottomAlignment)); 56 kTrayLabelItemHorizontalPaddingBottomAlignment));
57 } else { 57 } else {
(...skipping 19 matching lines...) Expand all
77 // Do not descend into static text labels which may compute their own labels 77 // Do not descend into static text labels which may compute their own labels
78 // recursively. 78 // recursively.
79 if (temp_state.role == ui::AX_ROLE_STATIC_TEXT) 79 if (temp_state.role == ui::AX_ROLE_STATIC_TEXT)
80 return; 80 return;
81 81
82 for (int i = 0; i < view->child_count(); ++i) 82 for (int i = 0; i < view->child_count(); ++i)
83 GetAccessibleLabelFromDescendantViews(view->child_at(i), out_labels); 83 GetAccessibleLabelFromDescendantViews(view->child_at(i), out_labels);
84 } 84 }
85 85
86 } // namespace ash 86 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698