OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_popup_utils.h" | 5 #include "ash/common/system/tray/tray_popup_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/system/tray/fixed_sized_image_view.h" | 8 #include "ash/common/system/tray/fixed_sized_image_view.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_popup_label_button.h" | 10 #include "ash/common/system/tray/tray_popup_label_button.h" |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 return CreateDefaultCenterLayoutManager(); | 70 return CreateDefaultCenterLayoutManager(); |
71 } | 71 } |
72 // Required by some compilers. | 72 // Required by some compilers. |
73 NOTREACHED(); | 73 NOTREACHED(); |
74 return nullptr; | 74 return nullptr; |
75 } | 75 } |
76 | 76 |
77 views::Label* TrayPopupUtils::CreateDefaultLabel() { | 77 views::Label* TrayPopupUtils::CreateDefaultLabel() { |
78 views::Label* label = new views::Label(); | 78 views::Label* label = new views::Label(); |
79 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); | 79 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); |
80 label->SetBorder( | 80 label->SetBorder(views::CreateEmptyBorder(0, kTrayPopupLabelHorizontalPadding, |
81 views::Border::CreateEmptyBorder(0, kTrayPopupLabelHorizontalPadding, 0, | 81 0, |
82 kTrayPopupLabelHorizontalPadding)); | 82 kTrayPopupLabelHorizontalPadding)); |
83 | 83 |
84 // TODO(bruthig): Fix this so that |label| uses the kBackgroundColor to | 84 // TODO(bruthig): Fix this so that |label| uses the kBackgroundColor to |
85 // perform subpixel rendering instead of disabling subpixel rendering. | 85 // perform subpixel rendering instead of disabling subpixel rendering. |
86 // | 86 // |
87 // Text rendered on a non-opaque background looks ugly and it is possible for | 87 // Text rendered on a non-opaque background looks ugly and it is possible for |
88 // labels to given a a clear canvas at paint time when an ink drop is visible. | 88 // labels to given a a clear canvas at paint time when an ink drop is visible. |
89 // See http://crbug.com/661714. | 89 // See http://crbug.com/661714. |
90 label->SetSubpixelRenderingEnabled(false); | 90 label->SetSubpixelRenderingEnabled(false); |
91 | 91 |
92 return label; | 92 return label; |
(...skipping 28 matching lines...) Expand all Loading... |
121 tri_view->SetMinSize( | 121 tri_view->SetMinSize( |
122 TriView::Container::END, | 122 TriView::Container::END, |
123 gfx::Size(GetTrayConstant(TRAY_POPUP_ITEM_MIN_END_WIDTH), 0)); | 123 gfx::Size(GetTrayConstant(TRAY_POPUP_ITEM_MIN_END_WIDTH), 0)); |
124 break; | 124 break; |
125 } | 125 } |
126 | 126 |
127 tri_view->SetContainerLayout(container, CreateLayoutManager(container)); | 127 tri_view->SetContainerLayout(container, CreateLayoutManager(container)); |
128 } | 128 } |
129 | 129 |
130 } // namespace ash | 130 } // namespace ash |
OLD | NEW |