| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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( |
| 81 views::Border::CreateEmptyBorder(0, kTrayPopupLabelHorizontalPadding, 0, | 81 views::Border::CreateEmptyBorder(0, kTrayPopupLabelHorizontalPadding, 0, |
| 82 kTrayPopupLabelHorizontalPadding)); | 82 kTrayPopupLabelHorizontalPadding)); |
| 83 |
| 84 // TODO(bruthig): Fix this so that |label| uses the kBackgroundColor to |
| 85 // perform subpixel rendering instead of disabling subpixel rendering. |
| 86 // |
| 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. |
| 89 // See http://crbug.com/661714. |
| 90 label->SetSubpixelRenderingEnabled(false); |
| 91 |
| 83 return label; | 92 return label; |
| 84 } | 93 } |
| 85 | 94 |
| 86 views::ImageView* TrayPopupUtils::CreateMainImageView() { | 95 views::ImageView* TrayPopupUtils::CreateMainImageView() { |
| 87 return new FixedSizedImageView( | 96 return new FixedSizedImageView( |
| 88 GetTrayConstant(TRAY_POPUP_ITEM_MAIN_IMAGE_CONTAINER_WIDTH), | 97 GetTrayConstant(TRAY_POPUP_ITEM_MAIN_IMAGE_CONTAINER_WIDTH), |
| 89 GetTrayConstant(TRAY_POPUP_ITEM_HEIGHT)); | 98 GetTrayConstant(TRAY_POPUP_ITEM_HEIGHT)); |
| 90 } | 99 } |
| 91 | 100 |
| 92 views::ImageView* TrayPopupUtils::CreateMoreImageView() { | 101 views::ImageView* TrayPopupUtils::CreateMoreImageView() { |
| (...skipping 19 matching lines...) Expand all Loading... |
| 112 tri_view->SetMinSize( | 121 tri_view->SetMinSize( |
| 113 TriView::Container::END, | 122 TriView::Container::END, |
| 114 gfx::Size(GetTrayConstant(TRAY_POPUP_ITEM_MIN_END_WIDTH), 0)); | 123 gfx::Size(GetTrayConstant(TRAY_POPUP_ITEM_MIN_END_WIDTH), 0)); |
| 115 break; | 124 break; |
| 116 } | 125 } |
| 117 | 126 |
| 118 tri_view->SetContainerLayout(container, CreateLayoutManager(container)); | 127 tri_view->SetContainerLayout(container, CreateLayoutManager(container)); |
| 119 } | 128 } |
| 120 | 129 |
| 121 } // namespace ash | 130 } // namespace ash |
| OLD | NEW |