IconMenuBaseDelegate#

class omni.kit.menu.core.IconMenuBaseDelegate(**kwargs)#

Bases: MenuDelegate

Icon Menu Delegate class.

Keyword Arguments:
  • background_color (int) – Background color of the menu.

  • background_selected_color (int) – Background color when an item is selected.

  • icon_size (float) – Size of the icons.

  • text_size (float) – Size of the text.

  • tick_size (float) – Size of the tick marks.

  • separator_size (list) – Size of the separators.

  • tick_spacing (list) – Spacing of the tick marks.

  • margin_size (list) – Margin size.

  • margin_size_posttick (list) – Margin size after the tick mark.

  • post_label_spaces (float) – Space after the label.

  • root_spacing (float) – Spacing at the root level.

  • submenu_pre_spacing (float) – Pre-spacing for submenu items.

  • submenu_spacing (float) – Spacing for submenu items.

  • submenu_icon_size (float) – Size of the submenu icons.

  • item_spacing (list) – Spacing for menu items.

  • icon_spacing (list) – Spacing for icons.

  • hotkey_spacing (list) – Spacing for hotkeys.

  • color_label_enabled (int) – Color of the label when enabled.

  • color_label_disabled (int) – Color of the label when disabled.

  • color_tick_enabled (int) – Color of the tick mark when enabled.

  • color_tick_disabled (int) – Color of the tick mark when disabled.

  • color_separator (int) – Color of the separators.

  • color_icon_enabled (int) – Color of the icon when enabled.

  • color_icon_disabled (int) – Color of the icon when disabled.

  • menu_title_text_color (int) – Color of the menu title text.

  • menu_title_color (int) – Color of the menu title.

  • menu_title_line_color (int) – Color of the menu title line.

  • menu_title_text_height (float) – Height of the menu title text.

  • menu_title_text_spacer (list) – Spacer size for the menu title text.

  • menu_title_close_icon_size (float) – Size of the close icon in the menu title.

  • menu_title_close_color (int) – Color of the close icon in the menu title.

  • menu_headfoot_spacing (float) – Menu header & footer spacing.

  • show_menu_titles (bool) – Whether to show menu titles.

  • indent_all_ticks (bool) – Whether to indent all tick marks.

Methods

__init__(**kwargs)

Initializes the IconMenuBaseDelegate.

build_item(item)

Build menu omni.ui for item, only uiMenu or uiMenuItem are handled by this function, anything else is handled by the ui.MenuDelegate base-class.

build_status(item)

Builds the footer for a menu item.

build_title(item)

Builds the header for a menu item.

get_style()

Get current style

load_settings(extension)

Loads settings from /exts/{extension}/* which control how menus are built.

Attributes

__init__(**kwargs)#

Initializes the IconMenuBaseDelegate.

build_item(item: Widget)#

Build menu omni.ui for item, only uiMenu or uiMenuItem are handled by this function, anything else is handled by the ui.MenuDelegate base-class. Can be overridden on subclass along with _build_item_header, _build_item_tick, _build_item_glyph, _build_item_label, _build_item_hotkey, _build_item_subdir.

Parameters:

item (ui.Widget) – The menu item to build.

Returns:

None

build_status(item)#

Builds the footer for a menu item.

Parameters:

item (ui.MenuItem) – The menu item for which to build the footer.

Returns:

None

build_title(item)#

Builds the header for a menu item.

Parameters:

item (ui.MenuItem) – The menu item for which to build the header.

Returns:

None

get_style()#

Get current style

Returns:

The current menu style.

Return type:

DictReadOnly

load_settings(extension)#

Loads settings from /exts/{extension}/* which control how menus are built.

Parameters:

extension (str) – Extension identifier for settings.