TrayIcon

external class TrayIcon : Resource(source)

Tray icon class and associated methods. This type constructor is private, instead, you should use the static method {@linkcode TrayIcon.new}.

Warning

Unlike Rust, javascript does not have any way to run cleanup code when an object is being removed by garbage collection, but this tray icon will be cleaned up when the tauri app exists, however if you want to cleanup this object early, you need to call {@linkcode TrayIcon.close}.

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
var id: String

The id associated with this tray icon.

Link copied to clipboard
val rid: Double

Functions

Link copied to clipboard

Destroys and cleans up this resource from memory. You should not call any method on this object anymore and should drop any reference to it.

Link copied to clipboard
fun setIcon(icon: Uint8Array<*>?): Promise<Void>
fun setIcon(icon: String?): Promise<Void>
fun setIcon(icon: Image?): Promise<Void>

Sets a new tray icon. If null is provided, it will remove the icon.

Link copied to clipboard

Sets the current icon as a template. macOS only

Link copied to clipboard
fun setMenu(menu: Menu?): Promise<Void>
fun setMenu(menu: Submenu?): Promise<Void>

Sets a new tray menu.

Link copied to clipboard

Disable or enable showing the tray menu on left click.

Link copied to clipboard

Disable or enable showing the tray menu on left click.

Link copied to clipboard

Sets the tray icon temp dir path. Linux only.

Link copied to clipboard
fun setTitle(title: String?): Promise<Void>

Sets the tooltip for this tray icon.

Link copied to clipboard
fun setTooltip(tooltip: String?): Promise<Void>

Sets the tooltip for this tray icon.

Link copied to clipboard
fun setVisible(visible: Boolean): Promise<Void>

Show or hide this tray icon.