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

Unified Diff: ui/views/controls/menu/menu_item_view.cc

Issue 25444004: views menus: fix alignment of items that have both checks and icons (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_item_view.cc
diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc
index 1e526f1647482bbbcbf359b3d9eb87c2db7708bf..02f513d3f03a781b15970fef0a46d263909cdeeb 100644
--- a/ui/views/controls/menu/menu_item_view.cc
+++ b/ui/views/controls/menu/menu_item_view.cc
@@ -1037,7 +1037,12 @@ int MenuItemView::GetMaxIconViewWidth() const {
for (int i = 0; i < submenu_->GetMenuItemCount(); ++i) {
MenuItemView* menu_item = submenu_->GetMenuItemAt(i);
int temp_width = 0;
- if (menu_item->HasSubmenu()) {
+ if (menu_item->GetType() == CHECKBOX ||
+ menu_item->GetType() == RADIO) {
+ // If this item has a radio or checkbox, the icon will not affect
+ // alignment of other items.
+ continue;
+ } else if (menu_item->HasSubmenu()) {
temp_width = menu_item->GetMaxIconViewWidth();
} else if (menu_item->icon_view()) {
temp_width = menu_item->icon_view()->GetPreferredSize().width();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698