OLD | NEW |
---|---|
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 769 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
780 // Calculate some colors. | 780 // Calculate some colors. |
781 ui::NativeTheme::ColorId color_id; | 781 ui::NativeTheme::ColorId color_id; |
782 if (enabled()) { | 782 if (enabled()) { |
783 color_id = render_selection ? | 783 color_id = render_selection ? |
784 ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor: | 784 ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor: |
785 ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor; | 785 ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor; |
786 } else { | 786 } else { |
787 bool emphasized = delegate && | 787 bool emphasized = delegate && |
788 delegate->GetShouldUseDisabledEmphasizedForegroundColor( | 788 delegate->GetShouldUseDisabledEmphasizedForegroundColor( |
789 GetCommand()); | 789 GetCommand()); |
790 color_id = emphasized ? | 790 color_id = emphasized |
791 ui::NativeTheme::kColorId_DisabledEmphasizedMenuItemForegroundColor : | 791 ? ui::NativeTheme::kColorId_EnabledMenuItemForegroundColor |
Evan Stade
2016/09/30 18:02:36
it really seems like this is just a special case w
tdanderson
2016/09/30 21:00:56
SG, but if you're changing this then consider also
Evan Stade
2016/09/30 22:19:00
held my nose and changed it
| |
792 ui::NativeTheme::kColorId_DisabledMenuItemForegroundColor; | 792 : ui::NativeTheme::kColorId_DisabledMenuItemForegroundColor; |
793 } | 793 } |
794 SkColor fg_color = native_theme->GetSystemColor(color_id); | 794 SkColor fg_color = native_theme->GetSystemColor(color_id); |
795 SkColor override_foreground_color; | 795 SkColor override_foreground_color; |
796 if (delegate && delegate->GetForegroundColor(GetCommand(), | 796 if (delegate && delegate->GetForegroundColor(GetCommand(), |
797 render_selection, | 797 render_selection, |
798 &override_foreground_color)) { | 798 &override_foreground_color)) { |
799 fg_color = override_foreground_color; | 799 fg_color = override_foreground_color; |
800 } | 800 } |
801 SkColor icon_color = | 801 SkColor icon_color = |
802 render_selection && !ui::MaterialDesignController::IsModeMaterial() | 802 render_selection && !ui::MaterialDesignController::IsModeMaterial() |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 |
OLD | NEW |