| OLD | NEW |
| 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 "ui/views/controls/menu/menu_config.h" | 5 #include "ui/views/controls/menu/menu_config.h" |
| 6 | 6 |
| 7 #include "grit/ui_resources.h" | 7 #include "grit/ui_resources.h" |
| 8 #include "ui/base/layout.h" | 8 #include "ui/base/layout.h" |
| 9 #include "ui/base/native_theme/native_theme_aura.h" | 9 #include "ui/base/native_theme/native_theme_aura.h" |
| 10 #include "ui/base/resource/resource_bundle.h" | 10 #include "ui/base/resource/resource_bundle.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 24 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 25 config->arrow_to_edge_padding = 20; | 25 config->arrow_to_edge_padding = 20; |
| 26 config->icon_to_label_padding = 4; | 26 config->icon_to_label_padding = 4; |
| 27 config->arrow_width = rb.GetImageNamed(IDR_MENU_ARROW).ToImageSkia()->width(); | 27 config->arrow_width = rb.GetImageNamed(IDR_MENU_ARROW).ToImageSkia()->width(); |
| 28 const gfx::ImageSkia* check = rb.GetImageNamed(IDR_MENU_CHECK).ToImageSkia(); | 28 const gfx::ImageSkia* check = rb.GetImageNamed(IDR_MENU_CHECK).ToImageSkia(); |
| 29 // Add 4 to force some padding between check and label. | 29 // Add 4 to force some padding between check and label. |
| 30 config->check_width = check->width() + 4; | 30 config->check_width = check->width() + 4; |
| 31 config->check_height = check->height(); | 31 config->check_height = check->height(); |
| 32 config->item_left_margin = 4; | 32 config->item_left_margin = 4; |
| 33 config->item_min_height = 29; | 33 config->item_min_height = 29; |
| 34 // TODO(skuhne): Separators in menus should have the same padding in touch | 34 config->separator_height = 15; |
| 35 // mode but currently the touch wrench menu relies on separators having no | |
| 36 // padding to implement full-height buttons. | |
| 37 if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) | |
| 38 config->separator_height = 1; | |
| 39 else | |
| 40 config->separator_height = 15; | |
| 41 config->font = rb.GetFont(ResourceBundle::BaseFont); | 35 config->font = rb.GetFont(ResourceBundle::BaseFont); |
| 42 config->label_to_arrow_padding = 20; | 36 config->label_to_arrow_padding = 20; |
| 43 config->label_to_accelerator_padding = 20; | 37 config->label_to_accelerator_padding = 20; |
| 44 config->always_use_icon_to_label_padding = true; | 38 config->always_use_icon_to_label_padding = true; |
| 45 config->align_arrow_and_shortcut = true; | 39 config->align_arrow_and_shortcut = true; |
| 46 config->offset_context_menus = true; | 40 config->offset_context_menus = true; |
| 47 | 41 |
| 48 return config; | 42 return config; |
| 49 } | 43 } |
| 50 | 44 |
| 51 } // namespace views | 45 } // namespace views |
| OLD | NEW |