Skip to content

Commit

Permalink
* Update app menu to add items for side nav items
Browse files Browse the repository at this point in the history
  • Loading branch information
PikachuEXE committed Dec 16, 2022
1 parent 083ae0e commit 6115d3a
Showing 1 changed file with 90 additions and 16 deletions.
106 changes: 90 additions & 16 deletions src/main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -1131,22 +1131,6 @@ function runApp() {
{ type: 'separator' },
{ role: 'togglefullscreen' },
{ type: 'separator' },
{
label: 'History',
// MacOS: Command + Y
// Other OS: Ctrl + H
accelerator: process.platform === 'darwin' ? 'Cmd+Y' : 'Ctrl+H',
click: (_menuItem, browserWindow, _event) => {
if (browserWindow == null) { return }

browserWindow.webContents.send(
'change-view',
{ route: '/history' }
)
},
type: 'normal'
},
{ type: 'separator' },
{
label: 'Back',
accelerator: 'Alt+Left',
Expand All @@ -1173,6 +1157,96 @@ function runApp() {
},
]
},
{
label: 'Navigate',
submenu: [
{
label: 'Subscriptions',
click: (_menuItem, browserWindow, _event) => {
if (browserWindow == null) {
return
}

browserWindow.webContents.send(
'change-view',
{ route: '/subscriptions' }
)
},
type: 'normal'
},
{
label: 'Channels',
click: (_menuItem, browserWindow, _event) => {
if (browserWindow == null) {
return
}

browserWindow.webContents.send(
'change-view',
{ route: '/subscribedchannels' }
)
},
type: 'normal'
},
{
label: 'Trending',
click: (_menuItem, browserWindow, _event) => {
if (browserWindow == null) {
return
}

browserWindow.webContents.send(
'change-view',
{ route: '/trending' }
)
},
type: 'normal'
},
{
label: 'Most Popular',
click: (_menuItem, browserWindow, _event) => {
if (browserWindow == null) {
return
}

browserWindow.webContents.send(
'change-view',
{ route: '/popular' }
)
},
type: 'normal'
},
{
label: 'Playlists',
click: (_menuItem, browserWindow, _event) => {
if (browserWindow == null) {
return
}

browserWindow.webContents.send(
'change-view',
{ route: '/userplaylists' }
)
},
type: 'normal'
},
{
label: 'History',
// MacOS: Command + Y
// Other OS: Ctrl + H
accelerator: process.platform === 'darwin' ? 'Cmd+Y' : 'Ctrl+H',
click: (_menuItem, browserWindow, _event) => {
if (browserWindow == null) { return }

browserWindow.webContents.send(
'change-view',
{ route: '/history' }
)
},
type: 'normal'
},
],
},
{
role: 'window',
submenu: [
Expand Down

0 comments on commit 6115d3a

Please sign in to comment.