1.0.0 • Published 3 years ago

@webfocus/tray v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

Webfocus Tray

This is a WebfocusComponent implementation with access to the system tray.

After registering this component has the following properties to change the tray behavior: (See ctray for more information)

  • menu: MenuItem[]
  • setIcon: string
  • setTitle: string
  • showTray: () => void
  • closeTray: () => void
  • updateTray: () => void
  • addAction: (name: string, cb: () => void)

For each action added the component creates a new MenuItem. Menu can also be changed directly throught component.menu. After showTray, if no error occured this component is hidden from the webfocusApplication.

Use case example

let settings = require("@webfocus/tray");
webfocusApp.registerComponent(settings);

let server = webfocusApp.start();
settings.setIcon('path/to/favicon.ico');
settings.setTitle(webfocusApp.configuration.name);
settings.addAction("Open Application", () => open(`http://localhost:${server.address().port}/`));
settings.addAction("Close Tray", () => settings.closeTray());

Its calls transport.sendMail with the message argument. (See nodemailer message