Tray

class Tray(var icon: Painter = ColorPainter(Gray), var state: TrayState? = null, var tooltip: String? = null, var onAction: OnAction = {}, var menu: Menu = {})

A factory class for creating and configuring a tray icon.

Constructors

Link copied to clipboard
constructor(icon: Painter = ColorPainter(Gray), state: TrayState? = null, tooltip: String? = null, onAction: OnAction = {}, menu: Menu = {})

Properties

Link copied to clipboard
var icon: Painter

The icon to be displayed in the tray. Defaults to a gray box.

Link copied to clipboard
var menu: Menu

A composable function to create the tray menu.

Link copied to clipboard

The action to be performed when the tray icon is clicked.

Link copied to clipboard
var state: TrayState?

The state of the tray icon. Defaults to a remembered tray state.

Link copied to clipboard

The tooltip text to be displayed when hovering over the tray icon.

Functions

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

Composes the tray icon with the specified properties.

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

Sets the action to be performed when the tray icon is clicked.

operator fun Menu.invoke(block: Menu)

Sets the composable function to create the tray menu.