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

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

Issue 7491083: Implemented nicer battery status (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed unitialized ivars Created 9 years, 4 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 d6dbd352b6020f6375afd71e680674bf25fd3f53..956a167461fc27d52ba02ae33a0513ecae695260 100644
--- a/views/controls/menu/menu_item_view_gtk.cc
+++ b/views/controls/menu/menu_item_view_gtk.cc
@@ -29,13 +29,19 @@ const int kMinTouchHeight = 46;
#endif
gfx::Size MenuItemView::CalculatePreferredSize() {
+ gfx::Size child_size = GetChildPreferredSize();
+ if (child_count() == 1 && title_.size() == 0) {
achuithb 2011/08/09 18:58:07 title_.empty instead of comparison of size with 0?
+ return gfx::Size(
+ child_size.width(),
+ child_size.height() + GetBottomMargin() + GetTopMargin());
+ }
+
const gfx::Font& font = GetFont();
#if defined(TOUCH_UI)
int height = std::max(font.GetHeight(), kMinTouchHeight);
#else
int height = font.GetHeight();
#endif
- gfx::Size child_size = GetChildPreferredSize();
return gfx::Size(
font.GetStringWidth(title_) + label_start_ +
item_right_margin_ + child_size.width(),

Powered by Google App Engine
This is Rietveld 408576698