Item

class Item(var text: String = "Empty Item", var icon: Painter? = null, var enabled: Boolean = true, var mnemonic: Char? = null, var shortcut: KeyShortcut? = null, var onClick: OnClick = {})

Represents an item with various properties and actions.

Constructors

Link copied to clipboard
constructor(text: String = "Empty Item", icon: Painter? = null, enabled: Boolean = true, mnemonic: Char? = null, shortcut: KeyShortcut? = null, onClick: OnClick = {})

Properties

Link copied to clipboard

Indicates whether the item is enabled. Defaults to true.

Link copied to clipboard
var icon: Painter?

The icon to be displayed for the item. Defaults to null.

Link copied to clipboard

The mnemonic character for the item. Defaults to null.

Link copied to clipboard

The action to be performed when the item is clicked. Defaults to an empty action.

Link copied to clipboard
var shortcut: KeyShortcut?

The keyboard shortcut for the item. Defaults to null.

Link copied to clipboard

The text to be displayed for the item. Defaults to "Empty Item".

Functions

Link copied to clipboard
@Composable
fun compose(): @Composable () -> Unit

Composes the item with the specified properties.

Link copied to clipboard
operator fun OnClick.invoke(block: OnClick)

Sets the onClick action for the item.