mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2024-11-23 05:52:53 +01:00
21 lines
548 B
JavaScript
21 lines
548 B
JavaScript
|
const { Tray, Menu } = require("electron");
|
||
|
const trayModule = {};
|
||
|
let tray;
|
||
|
|
||
|
trayModule.addTray = function(options = { icon: "" }) {
|
||
|
tray = new Tray(options.icon);
|
||
|
};
|
||
|
|
||
|
trayModule.refreshTray = function() {
|
||
|
const contextMenu = Menu.buildFromTemplate([
|
||
|
{ label: "Item1", type: "radio" },
|
||
|
{ label: "Item2", type: "radio" },
|
||
|
{ label: "Item3", type: "radio", checked: true },
|
||
|
{ label: "Item4", type: "radio" },
|
||
|
]);
|
||
|
tray.setToolTip("This is my application.");
|
||
|
tray.setContextMenu(contextMenu);
|
||
|
};
|
||
|
|
||
|
module.exports = trayModule;
|