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

Side by Side Diff: ui/views/controls/menu/menu_item_view.cc

Issue 1637973002: Vectorize menu radio buttons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/controls/menu/menu_item_view.h" 5 #include "ui/views/controls/menu/menu_item_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/i18n/case_conversion.h" 9 #include "base/i18n/case_conversion.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 gfx::ImageSkia check = GetMenuCheckImage(icon_color); 808 gfx::ImageSkia check = GetMenuCheckImage(icon_color);
809 // Don't use config.check_width here as it's padded 809 // Don't use config.check_width here as it's padded
810 // to force more padding (AURA). 810 // to force more padding (AURA).
811 gfx::Rect check_bounds(icon_x, 811 gfx::Rect check_bounds(icon_x,
812 top_margin + (available_height - check.height()) / 2, 812 top_margin + (available_height - check.height()) / 2,
813 check.width(), 813 check.width(),
814 check.height()); 814 check.height());
815 AdjustBoundsForRTLUI(&check_bounds); 815 AdjustBoundsForRTLUI(&check_bounds);
816 canvas->DrawImageInt(check, check_bounds.x(), check_bounds.y()); 816 canvas->DrawImageInt(check, check_bounds.x(), check_bounds.y());
817 } else if (type_ == RADIO) { 817 } else if (type_ == RADIO) {
818 gfx::ImageSkia image = 818 gfx::ImageSkia image = GetRadioButtonImage(
819 GetRadioButtonImage(delegate->IsItemChecked(GetCommand())); 819 delegate->IsItemChecked(GetCommand()), render_selection, icon_color);
820 gfx::Rect radio_bounds(icon_x, 820 gfx::Rect radio_bounds(icon_x,
821 top_margin + (available_height - image.height()) / 2, 821 top_margin + (available_height - image.height()) / 2,
822 image.width(), 822 image.width(),
823 image.height()); 823 image.height());
824 AdjustBoundsForRTLUI(&radio_bounds); 824 AdjustBoundsForRTLUI(&radio_bounds);
825 canvas->DrawImageInt(image, radio_bounds.x(), radio_bounds.y()); 825 canvas->DrawImageInt(image, radio_bounds.x(), radio_bounds.y());
826 } 826 }
827 827
828 // Render the foreground. 828 // Render the foreground.
829 const gfx::FontList& font_list = GetFontList(); 829 const gfx::FontList& font_list = GetFontList();
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
1081 } else { 1081 } else {
1082 const Type& type = menu_item->GetType(); 1082 const Type& type = menu_item->GetType();
1083 if (type == CHECKBOX || type == RADIO) 1083 if (type == CHECKBOX || type == RADIO)
1084 return true; 1084 return true;
1085 } 1085 }
1086 } 1086 }
1087 return false; 1087 return false;
1088 } 1088 }
1089 1089
1090 } // namespace views 1090 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698