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

Side by Side Diff: views/controls/menu/menu_item_view_linux.cc

Issue 7825024: For Touch: remove some menu items for experimentation, adjust sizes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: copyright Created 9 years, 3 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 | « views/controls/menu/menu_item_view.cc ('k') | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "views/controls/menu/menu_item_view.h" 5 #include "views/controls/menu/menu_item_view.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "grit/ui_resources.h" 8 #include "grit/ui_resources.h"
9 #include "third_party/skia/include/effects/SkGradientShader.h" 9 #include "third_party/skia/include/effects/SkGradientShader.h"
10 #include "ui/base/resource/resource_bundle.h" 10 #include "ui/base/resource/resource_bundle.h"
11 #include "ui/gfx/canvas_skia.h" 11 #include "ui/gfx/canvas_skia.h"
12 #include "ui/gfx/favicon_size.h" 12 #include "ui/gfx/favicon_size.h"
13 #include "views/controls/button/text_button.h" 13 #include "views/controls/button/text_button.h"
14 #include "views/controls/menu/menu_config.h" 14 #include "views/controls/menu/menu_config.h"
15 #include "views/controls/menu/menu_image_util_linux.h" 15 #include "views/controls/menu/menu_image_util_linux.h"
16 #include "views/controls/menu/submenu_view.h" 16 #include "views/controls/menu/submenu_view.h"
17 17
18 namespace views { 18 namespace views {
19 19
20 // Background color when the menu item is selected. 20 // Background color when the menu item is selected.
21 #if defined(OS_CHROMEOS) 21 #if defined(OS_CHROMEOS)
22 static const SkColor kSelectedBackgroundColor = SkColorSetRGB(0xDC, 0xE4, 0xFA); 22 static const SkColor kSelectedBackgroundColor = SkColorSetRGB(0xDC, 0xE4, 0xFA);
23 #else 23 #else
24 static const SkColor kSelectedBackgroundColor = SkColorSetRGB(246, 249, 253); 24 static const SkColor kSelectedBackgroundColor = SkColorSetRGB(246, 249, 253);
25 #endif 25 #endif
26 26
27 #if defined(TOUCH_UI) 27 #if defined(TOUCH_UI)
28 const int kMinTouchHeight = 46; 28 const int kMinTouchHeight = 40;
29 #endif 29 #endif
30 30
31 gfx::Size MenuItemView::CalculatePreferredSize() { 31 gfx::Size MenuItemView::CalculatePreferredSize() {
32 gfx::Size child_size = GetChildPreferredSize(); 32 gfx::Size child_size = GetChildPreferredSize();
33 if (child_count() == 1 && title_.size() == 0) { 33 if (child_count() == 1 && title_.size() == 0) {
34 return gfx::Size( 34 return gfx::Size(
35 child_size.width(), 35 child_size.width(),
36 child_size.height() + GetBottomMargin() + GetTopMargin()); 36 child_size.height() + GetBottomMargin() + GetTopMargin());
37 } 37 }
38 38
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 top_margin + (available_height - 132 top_margin + (available_height -
133 config.arrow_width) / 2, 133 config.arrow_width) / 2,
134 config.arrow_width, height()); 134 config.arrow_width, height());
135 AdjustBoundsForRTLUI(&arrow_bounds); 135 AdjustBoundsForRTLUI(&arrow_bounds);
136 canvas->DrawBitmapInt(*GetSubmenuArrowImage(), 136 canvas->DrawBitmapInt(*GetSubmenuArrowImage(),
137 arrow_bounds.x(), arrow_bounds.y()); 137 arrow_bounds.x(), arrow_bounds.y());
138 } 138 }
139 } 139 }
140 140
141 } // namespace views 141 } // namespace views
OLDNEW
« no previous file with comments | « views/controls/menu/menu_item_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698