added the option to disable the system tray icon and fixed the settings menu

This commit is contained in:
2020-10-07 20:10:31 +02:00
parent c222113cf1
commit e2ea4d13c4
11 changed files with 51 additions and 20 deletions

View File

@@ -14,6 +14,7 @@ const store = new Store({
apiSettings: {
port: 47836,
},
trayIcon: true,
mpris: false,
windowBounds: { width: 800, height: 600 },
},

View File

@@ -3,12 +3,15 @@ const { getMenu } = require("./menu");
const trayModule = {};
let tray;
trayModule.addTray = function(options = { icon: "" }) {
trayModule.addTray = function (options = { icon: "" }) {
tray = new Tray(options.icon);
};
trayModule.refreshTray = function() {
tray.on("click", function(e) {
trayModule.refreshTray = function () {
if (!tray) {
trayModule.addTray();
}
tray.on("click", function (e) {
// do nothing on click
});