ApplicationScope



Scope used by application, awaitApplication, launchApplication

Summary

Public functions

Unit
android

Extension functions

Unit
@Composable
ApplicationScope.Tray(
    icon: Painter,
    state: TrayState,
    tooltip: String?,
    onAction: () -> Unit,
    menu: @Composable MenuScope.() -> Unit
)

Adds tray icon to the platform taskbar if it is supported.

android

Public functions

exitApplication

fun exitApplication(): Unit

Extension functions

Tray

@Composable
fun ApplicationScope.Tray(
    icon: Painter,
    state: TrayState = rememberTrayState(),
    tooltip: String? = null,
    onAction: () -> Unit = {},
    menu: @Composable MenuScope.() -> Unit = {}
): Unit

Adds tray icon to the platform taskbar if it is supported.

If tray icon isn't supported by the platform, in the "standard" error output stream will be printed an error.

See isTraySupported to know if tray icon is supported (for example to show/hide an option in the application settings)

Parameters
icon: Painter

Icon of the tray

state: TrayState = rememberTrayState()

State to control tray and show notifications

tooltip: String? = null

Hint/tooltip that will be shown to the user

onAction: () -> Unit = {}

Action performed when user clicks on the tray icon (double click on Windows, right click on macOs)

menu: @Composable MenuScope.() -> Unit = {}

Context menu of the tray that will be shown to the user on the mouse click (right click on Windows, left click on macOs). If it doesn't contain any items then context menu will not be shown.