mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
views: Support styling of menus (issue #2102)
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user