Commit 8fa8af35 authored by Marshall Greenblatt's avatar Marshall Greenblatt

views: Support styling of menus (issue #2102)

parent b08f0ed7
......@@ -301,6 +301,8 @@
'tests/cefclient/browser/temp_window_win.h',
'tests/cefclient/browser/views_menu_bar.cc',
'tests/cefclient/browser/views_menu_bar.h',
'tests/cefclient/browser/views_style.cc',
'tests/cefclient/browser/views_style.h',
'tests/cefclient/browser/views_window.cc',
'tests/cefclient/browser/views_window.h',
'tests/cefclient/browser/window_test_runner_views.cc',
......@@ -354,6 +356,8 @@
'tests/cefclient/browser/temp_window_x11.h',
'tests/cefclient/browser/views_menu_bar.cc',
'tests/cefclient/browser/views_menu_bar.h',
'tests/cefclient/browser/views_style.cc',
'tests/cefclient/browser/views_style.h',
'tests/cefclient/browser/views_window.cc',
'tests/cefclient/browser/views_window.h',
'tests/cefclient/browser/window_test_runner_gtk.cc',
......
......@@ -384,6 +384,73 @@ typedef struct _cef_menu_model_t {
int (CEF_CALLBACK *get_accelerator_at)(struct _cef_menu_model_t* self,
int index, int* key_code, int* shift_pressed, int* ctrl_pressed,
int* alt_pressed);
///
// Set the explicit color for |command_id| and |color_type| to |color|.
// Specify a |color| value of 0 to remove the explicit color. If no explicit
// color or default color is set for |color_type| then the system color will
// be used. Returns true (1) on success.
///
int (CEF_CALLBACK *set_color)(struct _cef_menu_model_t* self, int command_id,
cef_menu_color_type_t color_type, cef_color_t color);
///
// Set the explicit color for |command_id| and |index| to |color|. Specify a
// |color| value of 0 to remove the explicit color. Specify an |index| value
// of -1 to set the default color for items that do not have an explicit color
// set. If no explicit color or default color is set for |color_type| then the
// system color will be used. Returns true (1) on success.
///
int (CEF_CALLBACK *set_color_at)(struct _cef_menu_model_t* self, int index,
cef_menu_color_type_t color_type, cef_color_t color);
///
// Returns in |color| the color that was explicitly set for |command_id| and
// |color_type|. If a color was not set then 0 will be returned in |color|.
// Returns true (1) on success.
///
int (CEF_CALLBACK *get_color)(struct _cef_menu_model_t* self, int command_id,
cef_menu_color_type_t color_type, cef_color_t* color);
///
// Returns in |color| the color that was explicitly set for |command_id| and
// |color_type|. Specify an |index| value of -1 to return the default color in
// |color|. If a color was not set then 0 will be returned in |color|. Returns
// true (1) on success.
///
int (CEF_CALLBACK *get_color_at)(struct _cef_menu_model_t* self, int index,
cef_menu_color_type_t color_type, cef_color_t* color);
///
// Sets the font list for the specified |command_id|. If |font_list| is NULL
// the system font will be used. Returns true (1) on success. The format is
// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where: - FONT_FAMILY_LIST is a comma-
// separated list of font family names, - STYLES is an optional space-
// separated list of style names (case-sensitive
// "Bold" and "Italic" are supported), and
// - SIZE is an integer font size in pixels with the suffix "px".
//
// Here are examples of valid font description strings: - "Arial, Helvetica,
// Bold Italic 14px" - "Arial, 14px"
///
int (CEF_CALLBACK *set_font_list)(struct _cef_menu_model_t* self,
int command_id, const cef_string_t* font_list);
///
// Sets the font list for the specified |index|. Specify an |index| value of
// -1 to set the default font. If |font_list| is NULL the system font will be
// used. Returns true (1) on success. The format is
// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where: - FONT_FAMILY_LIST is a comma-
// separated list of font family names, - STYLES is an optional space-
// separated list of style names (case-sensitive
// "Bold" and "Italic" are supported), and
// - SIZE is an integer font size in pixels with the suffix "px".
//
// Here are examples of valid font description strings: - "Arial, Helvetica,
// Bold Italic 14px" - "Arial, 14px"
///
int (CEF_CALLBACK *set_font_list_at)(struct _cef_menu_model_t* self,
int index, const cef_string_t* font_list);
} cef_menu_model_t;
......
......@@ -411,6 +411,85 @@ class CefMenuModel : public virtual CefBaseRefCounted {
bool& shift_pressed,
bool& ctrl_pressed,
bool& alt_pressed) =0;
///
// Set the explicit color for |command_id| and |color_type| to |color|.
// Specify a |color| value of 0 to remove the explicit color. If no explicit
// color or default color is set for |color_type| then the system color will
// be used. Returns true on success.
///
/*--cef()--*/
virtual bool SetColor(int command_id,
cef_menu_color_type_t color_type,
cef_color_t color) =0;
///
// Set the explicit color for |command_id| and |index| to |color|. Specify a
// |color| value of 0 to remove the explicit color. Specify an |index| value
// of -1 to set the default color for items that do not have an explicit
// color set. If no explicit color or default color is set for |color_type|
// then the system color will be used. Returns true on success.
///
/*--cef()--*/
virtual bool SetColorAt(int index,
cef_menu_color_type_t color_type,
cef_color_t color) =0;
///
// Returns in |color| the color that was explicitly set for |command_id| and
// |color_type|. If a color was not set then 0 will be returned in |color|.
// Returns true on success.
///
/*--cef()--*/
virtual bool GetColor(int command_id,
cef_menu_color_type_t color_type,
cef_color_t& color) =0;
///
// Returns in |color| the color that was explicitly set for |command_id| and
// |color_type|. Specify an |index| value of -1 to return the default color
// in |color|. If a color was not set then 0 will be returned in |color|.
// Returns true on success.
///
/*--cef()--*/
virtual bool GetColorAt(int index,
cef_menu_color_type_t color_type,
cef_color_t& color) =0;
///
// Sets the font list for the specified |command_id|. If |font_list| is empty
// the system font will be used. Returns true on success. The format is
// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where:
// - FONT_FAMILY_LIST is a comma-separated list of font family names,
// - STYLES is an optional space-separated list of style names (case-sensitive
// "Bold" and "Italic" are supported), and
// - SIZE is an integer font size in pixels with the suffix "px".
//
// Here are examples of valid font description strings:
// - "Arial, Helvetica, Bold Italic 14px"
// - "Arial, 14px"
///
/*--cef(optional_param=font_list)--*/
virtual bool SetFontList(int command_id,
const CefString& font_list) =0;
///
// Sets the font list for the specified |index|. Specify an |index| value of
// -1 to set the default font. If |font_list| is empty the system font will
// be used. Returns true on success. The format is
// "<FONT_FAMILY_LIST>,[STYLES] <SIZE>", where:
// - FONT_FAMILY_LIST is a comma-separated list of font family names,
// - STYLES is an optional space-separated list of style names (case-sensitive
// "Bold" and "Italic" are supported), and
// - SIZE is an integer font size in pixels with the suffix "px".
//
// Here are examples of valid font description strings:
// - "Arial, Helvetica, Bold Italic 14px"
// - "Arial, 14px"
///
/*--cef(optional_param=font_list)--*/
virtual bool SetFontListAt(int index,
const CefString& font_list) =0;
};
#endif // CEF_INCLUDE_CEF_MENU_MODEL_H_
......@@ -2732,6 +2732,19 @@ typedef enum {
CEF_MENU_ANCHOR_BOTTOMCENTER,
} cef_menu_anchor_position_t;
///
// Supported color types for menu items.
///
typedef enum {
CEF_MENU_COLOR_TEXT,
CEF_MENU_COLOR_TEXT_HOVERED,
CEF_MENU_COLOR_TEXT_ACCELERATOR,
CEF_MENU_COLOR_TEXT_ACCELERATOR_HOVERED,
CEF_MENU_COLOR_BACKGROUND,
CEF_MENU_COLOR_BACKGROUND_HOVERED,
CEF_MENU_COLOR_COUNT,
} cef_menu_color_type_t;
// Supported SSL version values. See net/ssl/ssl_connection_status_flags.h
// for more information.
typedef enum {
......
This diff is collapsed.
......@@ -14,6 +14,7 @@
#include "base/threading/platform_thread.h"
#include "ui/base/models/menu_model.h"
#include "ui/gfx/font_list.h"
namespace content {
struct MenuItem;
......@@ -123,15 +124,37 @@ class CefMenuModelImpl : public CefMenuModel {
bool& shift_pressed, bool& ctrl_pressed, bool& alt_pressed) override;
bool GetAcceleratorAt(int index, int& key_code, bool& shift_pressed,
bool& ctrl_pressed, bool& alt_pressed) override;
bool SetColor(int command_id,
cef_menu_color_type_t color_type,
cef_color_t color) override;
bool SetColorAt(int index,
cef_menu_color_type_t color_type,
cef_color_t color) override;
bool GetColor(int command_id,
cef_menu_color_type_t color_type,
cef_color_t& color) override;
bool GetColorAt(int index,
cef_menu_color_type_t color_type,
cef_color_t& color) override;
bool SetFontList(int command_id, const CefString& font_list) override;
bool SetFontListAt(int index, const CefString& font_list) override;
// Callbacks from the ui::MenuModel implementation.
void ActivatedAt(int index, cef_event_flags_t event_flags);
void MouseOutsideMenu(const gfx::Point& screen_point);
void UnhandledOpenSubmenu(bool is_rtl);
void UnhandledCloseSubmenu(bool is_rtl);
bool GetTextColor(int index,
bool is_accelerator,
bool is_hovered,
SkColor* override_color) const;
bool GetBackgroundColor(int index,
bool is_hovered,
SkColor* override_color) const;
void MenuWillShow();
void MenuWillClose();
base::string16 GetFormattedLabelAt(int index);
const gfx::FontList* GetLabelFontListAt(int index) const;
// Verify that only a single reference exists to all CefMenuModelImpl objects.
bool VerifyRefCount();
......@@ -182,6 +205,11 @@ class CefMenuModelImpl : public CefMenuModel {
ItemVector items_;
std::unique_ptr<ui::MenuModel> model_;
// Style information.
cef_color_t default_colors_[CEF_MENU_COLOR_COUNT] = {0};
gfx::FontList default_font_list_;
bool has_default_font_list_ = false;
bool auto_notify_menu_closed_ = true;
IMPLEMENT_REFCOUNTING(CefMenuModelImpl);
......
......@@ -57,6 +57,13 @@ CEF_BUTTON_VIEW_T void CEF_BUTTON_VIEW_D::ButtonPressed(
views::Button* sender, const ui::Event& event) {
if (ParentClass::cef_delegate())
ParentClass::cef_delegate()->OnButtonPressed(GetCefButton());
if (ParentClass::ink_drop_mode() != views::CustomButton::InkDropMode::OFF &&
!ParentClass::IsFocusable()) {
// When ink drop is enabled for non-focusable buttons the ink drop state
// does not get reset properly on click, so we do it here explicitly.
ParentClass::AnimateInkDrop(views::InkDropState::HIDDEN,
ui::LocatedEvent::FromIfValid(&event));
}
}
#endif // CEF_LIBCEF_BROWSER_VIEWS_BUTTON_VIEW_H_
......@@ -5,6 +5,7 @@
#include "libcef/browser/views/menu_button_view.h"
#include "ui/gfx/canvas.h"
#include "ui/views/controls/menu/menu_config.h"
CefMenuButtonView::CefMenuButtonView(
CefMenuButtonDelegate* cef_delegate)
......@@ -17,6 +18,9 @@ void CefMenuButtonView::Initialize() {
SetDrawStringsFlags(IsFocusable() ? gfx::Canvas::SHOW_PREFIX :
gfx::Canvas::HIDE_PREFIX);
// Use the same default font as MenuItemView.
SetFontList(views::MenuConfig::instance().font_list);
}
CefRefPtr<CefMenuButton> CefMenuButtonView::GetCefMenuButton() const {
......
......@@ -994,6 +994,136 @@ int CEF_CALLBACK menu_model_get_accelerator_at(struct _cef_menu_model_t* self,
return _retval;
}
int CEF_CALLBACK menu_model_set_color(struct _cef_menu_model_t* self,
int command_id, cef_menu_color_type_t color_type, cef_color_t color) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->SetColor(
command_id,
color_type,
color);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_set_color_at(struct _cef_menu_model_t* self,
int index, cef_menu_color_type_t color_type, cef_color_t color) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->SetColorAt(
index,
color_type,
color);
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_get_color(struct _cef_menu_model_t* self,
int command_id, cef_menu_color_type_t color_type, cef_color_t* color) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Verify param: color; type: simple_byref
DCHECK(color);
if (!color)
return 0;
// Translate param: color; type: simple_byref
cef_color_t colorVal = color?*color:0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->GetColor(
command_id,
color_type,
colorVal);
// Restore param: color; type: simple_byref
if (color)
*color = colorVal;
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_get_color_at(struct _cef_menu_model_t* self,
int index, cef_menu_color_type_t color_type, cef_color_t* color) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Verify param: color; type: simple_byref
DCHECK(color);
if (!color)
return 0;
// Translate param: color; type: simple_byref
cef_color_t colorVal = color?*color:0;
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->GetColorAt(
index,
color_type,
colorVal);
// Restore param: color; type: simple_byref
if (color)
*color = colorVal;
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_set_font_list(struct _cef_menu_model_t* self,
int command_id, const cef_string_t* font_list) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Unverified params: font_list
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->SetFontList(
command_id,
CefString(font_list));
// Return type: bool
return _retval;
}
int CEF_CALLBACK menu_model_set_font_list_at(struct _cef_menu_model_t* self,
int index, const cef_string_t* font_list) {
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
DCHECK(self);
if (!self)
return 0;
// Unverified params: font_list
// Execute
bool _retval = CefMenuModelCppToC::Get(self)->SetFontListAt(
index,
CefString(font_list));
// Return type: bool
return _retval;
}
} // namespace
......@@ -1050,6 +1180,12 @@ CefMenuModelCppToC::CefMenuModelCppToC() {
GetStruct()->remove_accelerator_at = menu_model_remove_accelerator_at;
GetStruct()->get_accelerator = menu_model_get_accelerator;
GetStruct()->get_accelerator_at = menu_model_get_accelerator_at;
GetStruct()->set_color = menu_model_set_color;
GetStruct()->set_color_at = menu_model_set_color_at;
GetStruct()->get_color = menu_model_get_color;
GetStruct()->get_color_at = menu_model_get_color_at;
GetStruct()->set_font_list = menu_model_set_font_list;
GetStruct()->set_font_list_at = menu_model_set_font_list_at;
}
template<> CefRefPtr<CefMenuModel> CefCppToCRefCounted<CefMenuModelCppToC,
......
......@@ -915,6 +915,115 @@ bool CefMenuModelCToCpp::GetAcceleratorAt(int index, int& key_code,
return _retval?true:false;
}
bool CefMenuModelCToCpp::SetColor(int command_id,
cef_menu_color_type_t color_type, cef_color_t color) {
cef_menu_model_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, set_color))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->set_color(_struct,
command_id,
color_type,
color);
// Return type: bool
return _retval?true:false;
}
bool CefMenuModelCToCpp::SetColorAt(int index, cef_menu_color_type_t color_type,
cef_color_t color) {
cef_menu_model_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, set_color_at))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->set_color_at(_struct,
index,
color_type,
color);
// Return type: bool
return _retval?true:false;
}
bool CefMenuModelCToCpp::GetColor(int command_id,
cef_menu_color_type_t color_type, cef_color_t& color) {
cef_menu_model_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_color))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->get_color(_struct,
command_id,
color_type,
&color);
// Return type: bool
return _retval?true:false;
}
bool CefMenuModelCToCpp::GetColorAt(int index, cef_menu_color_type_t color_type,
cef_color_t& color) {
cef_menu_model_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, get_color_at))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Execute
int _retval = _struct->get_color_at(_struct,
index,
color_type,
&color);
// Return type: bool
return _retval?true:false;
}
bool CefMenuModelCToCpp::SetFontList(int command_id,
const CefString& font_list) {
cef_menu_model_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, set_font_list))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Unverified params: font_list
// Execute
int _retval = _struct->set_font_list(_struct,
command_id,
font_list.GetStruct());
// Return type: bool
return _retval?true:false;
}
bool CefMenuModelCToCpp::SetFontListAt(int index, const CefString& font_list) {
cef_menu_model_t* _struct = GetStruct();
if (CEF_MEMBER_MISSING(_struct, set_font_list_at))
return false;
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
// Unverified params: font_list
// Execute
int _retval = _struct->set_font_list_at(_struct,
index,
font_list.GetStruct());
// Return type: bool
return _retval?true:false;
}
// CONSTRUCTOR - Do not edit by hand.
......
......@@ -90,6 +90,16 @@ class CefMenuModelCToCpp
bool& ctrl_pressed, bool& alt_pressed) OVERRIDE;
bool GetAcceleratorAt(int index, int& key_code, bool& shift_pressed,
bool& ctrl_pressed, bool& alt_pressed) OVERRIDE;
bool SetColor(int command_id, cef_menu_color_type_t color_type,
cef_color_t color) OVERRIDE;
bool SetColorAt(int index, cef_menu_color_type_t color_type,
cef_color_t color) OVERRIDE;
bool GetColor(int command_id, cef_menu_color_type_t color_type,
cef_color_t& color) OVERRIDE;
bool GetColorAt(int index, cef_menu_color_type_t color_type,
cef_color_t& color) OVERRIDE;
bool SetFontList(int command_id, const CefString& font_list) OVERRIDE;
bool SetFontListAt(int index, const CefString& font_list) OVERRIDE;
};
#endif // CEF_LIBCEF_DLL_CTOCPP_MENU_MODEL_CTOCPP_H_
diff --git ui/base/models/menu_model.h ui/base/models/menu_model.h
index 0755f27..72db677 100644
index 0755f27..76ad6d6 100644
--- ui/base/models/menu_model.h
+++ ui/base/models/menu_model.h
@@ -15,6 +15,7 @@
......@@ -10,7 +10,7 @@ index 0755f27..72db677 100644
}
namespace ui {
@@ -115,6 +116,15 @@ class UI_BASE_EXPORT MenuModel {
@@ -115,6 +116,30 @@ class UI_BASE_EXPORT MenuModel {
// |event_flags| is a bit mask of ui::EventFlags.
virtual void ActivatedAt(int index, int event_flags);
......@@ -22,6 +22,21 @@ index 0755f27..72db677 100644
+ // true if the menu is displaying a right-to-left language.
+ virtual void UnhandledOpenSubmenu(bool is_rtl) {}
+ virtual void UnhandledCloseSubmenu(bool is_rtl) {}
+
+ // Override the text/background color of a given menu item dependent on the
+ // |index| and its |is_hovered| state. Returns true if it chooses to override
+ // the color.
+ virtual bool GetTextColor(int index,
+ bool is_hovered,
+ SkColor* override_color) const { return false; }
+ virtual bool GetMinorTextColor(int index,
+ bool is_hovered,
+ SkColor* override_color) const
+ { return false; }
+ virtual bool GetBackgroundColor(int index,
+ bool is_hovered,
+ SkColor* override_color) const
+ { return false; }
+
// Called when the menu is about to be shown.
virtual void MenuWillShow() {}
......@@ -231,10 +246,25 @@ index 79ff77c..a0582c0 100644
SetSelection(item, SELECTION_UPDATE_IMMEDIATELY);
else if (item->GetParentMenuItem()->GetParentMenuItem())
diff --git ui/views/controls/menu/menu_delegate.h ui/views/controls/menu/menu_delegate.h
index 3b7cb7f..3ad68d0 100644
index 3b7cb7f..7481553 100644
--- ui/views/controls/menu/menu_delegate.h
+++ ui/views/controls/menu/menu_delegate.h
@@ -229,6 +229,11 @@ class VIEWS_EXPORT MenuDelegate {
@@ -87,6 +87,14 @@ class VIEWS_EXPORT MenuDelegate {
bool is_hovered,
SkColor* override_color) const;
+ // Override the minor text color of a given menu item dependent on the
+ // |command_id| and its |is_hovered| state. Returns true if it chooses to
+ // override the color.
+ virtual bool GetMinorTextColor(int command_id,
+ bool is_hovered,
+ SkColor* override_color) const
+ { return false; }
+
// Override the background color of a given menu item dependent on the
// |command_id| and its |is_hovered| state. Returns true if it chooses to
// override the color.
@@ -229,6 +237,11 @@ class VIEWS_EXPORT MenuDelegate {
bool* has_mnemonics,
MenuButton** button);
......@@ -246,11 +276,44 @@ index 3b7cb7f..3ad68d0 100644
// Returns the max width menus can grow to be.
virtual int GetMaxWidthForMenu(MenuItemView* menu);
diff --git ui/views/controls/menu/menu_item_view.cc ui/views/controls/menu/menu_item_view.cc
index b4129049..a23670a 100644
--- ui/views/controls/menu/menu_item_view.cc
+++ ui/views/controls/menu/menu_item_view.cc
@@ -871,6 +871,17 @@ void MenuItemView::PaintMinorText(gfx::Canvas* canvas,
if (minor_text.empty())
return;
+ SkColor text_color;
+
+ MenuDelegate *delegate = GetDelegate();
+ if (!delegate || !delegate->GetMinorTextColor(GetCommand(),
+ render_selection,
+ &text_color)) {
+ text_color = GetNativeTheme()->GetSystemColor(render_selection ?
+ ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor :
+ ui::NativeTheme::kColorId_MenuItemSubtitleColor);
+ }
+
int available_height = height() - GetTopMargin() - GetBottomMargin();
int max_accel_width =
parent_menu_item_->GetSubmenu()->max_minor_text_width();
@@ -889,9 +900,7 @@ void MenuItemView::PaintMinorText(gfx::Canvas* canvas,
canvas->DrawStringRectWithFlags(
minor_text,
GetFontList(),
- GetNativeTheme()->GetSystemColor(render_selection ?
- ui::NativeTheme::kColorId_SelectedMenuItemForegroundColor :
- ui::NativeTheme::kColorId_MenuItemSubtitleColor),
+ text_color,
accel_bounds,
flags);
}
diff --git ui/views/controls/menu/menu_model_adapter.cc ui/views/controls/menu/menu_model_adapter.cc
index bc04dcb..b2ec114 100644
index bc04dcb..d786a0b 100644
--- ui/views/controls/menu/menu_model_adapter.cc
+++ ui/views/controls/menu/menu_model_adapter.cc
@@ -245,6 +245,49 @@ void MenuModelAdapter::SelectionChanged(MenuItemView* menu) {
@@ -245,6 +245,88 @@ void MenuModelAdapter::SelectionChanged(MenuItemView* menu) {