SubMenu

abstract fun SubMenu(label: String, isEnabled: Boolean = true, submenuContent: TrayMenuBuilder.() -> Unit?)

Adds a submenu to the tray menu.

Parameters

label

The text label for the submenu.

isEnabled

Indicates whether the submenu is enabled. Defaults to true.

submenuContent

A lambda function defining the contents of the submenu. Can be null.


abstract fun SubMenu(label: String, iconContent: () -> Unit, iconRenderProperties: IconRenderProperties = IconRenderProperties.forMenuItem(), isEnabled: Boolean = true, submenuContent: TrayMenuBuilder.() -> Unit?)

Adds a submenu to the tray menu with a Composable icon.

Parameters

label

The text label for the submenu.

iconContent

A Composable function that defines the icon.

iconRenderProperties

Properties for rendering the icon. Defaults to 16x16 for menu items.

isEnabled

Indicates whether the submenu is enabled. Defaults to true.

submenuContent

A lambda function defining the contents of the submenu. Can be null.


abstract fun SubMenu(label: String, icon: <Error class: unknown class>, iconTint: <Error class: unknown class>? = null, iconRenderProperties: IconRenderProperties = IconRenderProperties.forMenuItem(), isEnabled: Boolean = true, submenuContent: TrayMenuBuilder.() -> Unit?)

Adds a submenu to the tray menu with an ImageVector icon.

Parameters

label

The text label for the submenu.

icon

The ImageVector to display as icon.

iconTint

Optional tint color for the icon. If null, adapts to menu theme.

iconRenderProperties

Properties for rendering the icon. Defaults to 16x16 for menu items.

isEnabled

Indicates whether the submenu is enabled. Defaults to true.

submenuContent

A lambda function defining the contents of the submenu. Can be null.


abstract fun SubMenu(label: String, icon: <Error class: unknown class>, iconRenderProperties: IconRenderProperties = IconRenderProperties.forMenuItem(), isEnabled: Boolean = true, submenuContent: TrayMenuBuilder.() -> Unit?)

Adds a submenu to the tray menu with a Painter icon.

Parameters

label

The text label for the submenu.

icon

The Painter to display as icon.

iconRenderProperties

Properties for rendering the icon. Defaults to 16x16 for menu items.

isEnabled

Indicates whether the submenu is enabled. Defaults to true.

submenuContent

A lambda function defining the contents of the submenu. Can be null.


abstract fun SubMenu(label: String, icon: <Error class: unknown class>, iconRenderProperties: IconRenderProperties = IconRenderProperties.forMenuItem(), isEnabled: Boolean = true, submenuContent: TrayMenuBuilder.() -> Unit?)

Adds a submenu to the tray menu with a DrawableResource icon. This allows calling code like: SubMenu(label, icon = Res.drawable.icon) { ... }