Skip to content

Commit

Permalink
Clean up menus
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewkaney committed Oct 15, 2023
1 parent 112ab39 commit 278be1a
Showing 1 changed file with 33 additions and 13 deletions.
46 changes: 33 additions & 13 deletions app/desktop/src/main/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@ class ElectronMenu extends EventEmitter<MenuEvents> {
new MenuItem({
label: app.name,
submenu: [
{ role: "about" },
{
label: "About",
click: (_, window) => this.emit("about", window),
},
{ type: "separator" },
{ role: "hide" },
{ role: "unhide" },
Expand Down Expand Up @@ -191,17 +194,26 @@ class ElectronMenu extends EventEmitter<MenuEvents> {
);

// View Menu
this.menu.append(new MenuItem({ role: "viewMenu" }));

// Window Menu
this.menu.append(new MenuItem({ role: "windowMenu" }));
this.menu.append(
new MenuItem({
label: "View",
submenu: [
{ role: "resetZoom" },
{ role: "zoomIn", accelerator: "CommandOrControl+=" },
{ role: "zoomOut" },
{ type: "separator" },
{ role: "togglefullscreen" },
],
})
);

this.menu.append(
new MenuItem({
label: "Tidal",
submenu: [
{
label: "Reboot Tidal",
accelerator: "CommandOrControl+R",
click: (_, window) => this.emit("rebootTidal", window),
},
// { type: "separator" },
Expand All @@ -211,14 +223,22 @@ class ElectronMenu extends EventEmitter<MenuEvents> {
);

// Help Menu
this.menu.append(
new MenuItem({
role: "help",
submenu: [
{ label: "About", click: (_, window) => this.emit("about", window) },
],
})
);
const helpMenu = new MenuItem({
role: "help",
submenu: [{ role: "toggleDevTools" }],
});

if (!isMac) {
helpMenu.submenu?.append(new MenuItem({ type: "separator" }));
helpMenu.submenu?.append(
new MenuItem({
label: "About",
click: (_, window) => this.emit("about", window),
})
);
}

this.menu.append(helpMenu);

// Set application menu
Menu.setApplicationMenu(this.menu);
Expand Down

0 comments on commit 278be1a

Please sign in to comment.