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

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

Issue 7331017: Multi-Profiles: Add icon chooser to profiles menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove debug code 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_gtk.cc
diff --git a/views/controls/menu/menu_item_view_gtk.cc b/views/controls/menu/menu_item_view_gtk.cc
index 9ff9ca12462c61ee85569bb04ed95d54d9926070..d6dbd352b6020f6375afd71e680674bf25fd3f53 100644
--- a/views/controls/menu/menu_item_view_gtk.cc
+++ b/views/controls/menu/menu_item_view_gtk.cc
@@ -35,10 +35,12 @@ gfx::Size MenuItemView::CalculatePreferredSize() {
#else
int height = font.GetHeight();
#endif
+ gfx::Size child_size = GetChildPreferredSize();
return gfx::Size(
font.GetStringWidth(title_) + label_start_ +
- item_right_margin_ + GetChildPreferredWidth(),
- height + GetBottomMargin() + GetTopMargin());
+ item_right_margin_ + child_size.width(),
+ std::max(height, child_size.height()) + GetBottomMargin() +
+ GetTopMargin());
}
void MenuItemView::PaintButton(gfx::Canvas* canvas, PaintButtonMode mode) {

Powered by Google App Engine
This is Rietveld 408576698