tidal-hifi/src/scripts/tray.js

20 lines
409 B
JavaScript
Raw Normal View History

const { Tray } = require("electron");
const { getMenu } = require("./menu");
const trayModule = {};
let tray;
trayModule.addTray = function(options = { icon: "" }) {
tray = new Tray(options.icon);
};
trayModule.refreshTray = function() {
tray.on("click", function(e) {
// do nothing on click
});
tray.setToolTip("Tidal-hifi");
tray.setContextMenu(getMenu());
};
module.exports = trayModule;