mirror of
https://github.com/Mastermindzh/tidal-hifi.git
synced 2025-09-11 14:25:12 +02:00
added a custom menu and enabled the menu by default
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const { Tray, Menu } = require("electron");
|
||||
const { Tray } = require("electron");
|
||||
const { getMenu } = require("./menu");
|
||||
const trayModule = {};
|
||||
let tray;
|
||||
|
||||
@@ -7,14 +8,12 @@ trayModule.addTray = function(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);
|
||||
tray.on("click", function(e) {
|
||||
// do nothing on click
|
||||
});
|
||||
|
||||
tray.setToolTip("Tidal-hifi");
|
||||
tray.setContextMenu(getMenu());
|
||||
};
|
||||
|
||||
module.exports = trayModule;
|
||||
|
Reference in New Issue
Block a user