SystemTrayIconProps

The SystemTrayIcon component provides the ability to add and manipulate a native system tray icon. NodeGui's QSystemTrayIcon.

Example

<script lang="ts">
import { onMount } from "svelte";
import { QIcon, QAction } from "@nodegui/nodegui";
import path from "path";
onMount(() => {
(window as any).win = win; // Prevent garbage collection.
win.nativeView.show();
const icon = new QIcon(path.join(__dirname, "../extras/assets/nodegui.png"));
const action = new QAction();
action.setText("Hello");
function onTriggered(){
console.log("hello");
}
action.addEventListener("triggered", onTriggered);
return () => {
action.removeEventListener("triggered", onTriggered);
delete (window as any).win;
};
});
</script>
<window bind:this={win}>
<systemTrayIcon {icon} tooltip="Hello World" visible>
<menu actions={[action]}/>
</systemTrayIcon>
</window>

Hierarchy

  • RNProps

    ↳ SystemTrayIconProps

Index

Properties

Properties

Optional icon

• icon? : QIcon

Sets an icon for the system tray. QSystemTrayIcon: setIcon


Optional id

• id? : undefined | string

Sets the object name (id) of the widget in Qt. Object name can be analogous to id of an element in the web world. Using the objectName of the widget one can reference it in the Qt's stylesheet much like what we do with id in the web world. QWidget: setObjectName


Optional on

• on? : Partial‹WidgetEventListeners | QSystemTrayIconSignals›

Prop to set the event listener map. See Handlong Events


Optional tooltip

• tooltip? : undefined | string

Sets a tooltip for the system tray. QSystemTrayIcon: setTooltip


Optional visible

• visible? : undefined | false | true

Shows or hides the widget and its children. QWidget: show