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

Unified Diff: views/controls/menu/menu_item_view_win.cc

Issue 7331017: Multi-Profiles: Add icon chooser to profiles menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: close menu on button pressed Created 9 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: views/controls/menu/menu_item_view_win.cc
diff --git a/views/controls/menu/menu_item_view_win.cc b/views/controls/menu/menu_item_view_win.cc
index 92d73842fd1d3846f58a64adef262c72488e6345..923e2686a2a24702d14ba0bbcbf02236d40fdbf1 100644
--- a/views/controls/menu/menu_item_view_win.cc
+++ b/views/controls/menu/menu_item_view_win.cc
@@ -18,11 +18,13 @@ using gfx::NativeTheme;
namespace views {
gfx::Size MenuItemView::CalculatePreferredSize() {
+ gfx::Size child_size = GetChildPreferredSize();
const gfx::Font& font = GetFont();
return gfx::Size(
font.GetStringWidth(title_) + label_start_ + item_right_margin_ +
- GetChildPreferredWidth(),
- font.GetHeight() + GetBottomMargin() + GetTopMargin());
+ child_size.width(),
+ std::max(child_size.height(), font.GetHeight()) + GetBottomMargin() +
+ GetTopMargin());
}
void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {
« chrome/browser/ui/views/avatar_menu_button.h ('K') | « views/controls/menu/menu_item_view_gtk.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698