File tree Expand file tree Collapse file tree 6 files changed +60
-35
lines changed
Expand file tree Collapse file tree 6 files changed +60
-35
lines changed Original file line number Diff line number Diff line change 11import { appMenuTemplate } from './app_menu_template' ;
22import { fileMenuTemplate } from './file_menu_template' ;
33import { editMenuTemplate } from './edit_menu_template' ;
4- import { windowMenuTemplate } from './window_menu_template' ;
54import { settingsMenu } from './settings_menu_template' ;
5+ import { viewMenuTemplate } from './view_menu_template' ;
6+ import { windowMenuTemplate } from './window_menu_template' ;
67import { IS_MAC } from '../constants' ;
78
89
9- const baseMenuTemplate = [ editMenuTemplate , windowMenuTemplate ] ;
10+ const baseMenuTemplate = [ editMenuTemplate , viewMenuTemplate , windowMenuTemplate ] ;
1011
1112if ( IS_MAC ) {
1213 baseMenuTemplate . unshift ( appMenuTemplate ) ;
Original file line number Diff line number Diff line change 11import { app } from 'electron' ;
2+ import { IS_WINDOWS } from '../constants' ;
23import { checkForUpdatesMenuItem } from './items/check_for_updates' ;
4+ import { separator } from './items/separator' ;
5+
6+ const submenu = [ {
7+ label : 'Quit Android Messages' ,
8+ click : ( ) => app . quit ( )
9+ } ] ;
10+
11+ if ( ! IS_WINDOWS ) {
12+ submenu . unshift ( separator ) ;
13+ submenu . unshift ( checkForUpdatesMenuItem ) ;
14+ }
315
416export const fileMenuTemplate = {
517 label : 'File' ,
6- submenu : [
7- checkForUpdatesMenuItem ,
8- {
9- type : 'separator'
10- } ,
11- {
12- label : 'Quit Android Messages' ,
13- click : ( ) => app . quit ( )
14- }
15- ]
18+ submenu
1619} ;
Original file line number Diff line number Diff line change 11import { shell } from 'electron' ;
2- import { IS_MAC } from '../constants' ;
2+ import { IS_MAC , IS_WINDOWS } from '../constants' ;
33import { aboutMenuItem } from './items/about' ;
4+ import { checkForUpdatesMenuItem } from './items/check_for_updates' ;
5+ import { separator } from './items/separator' ;
46
5- export const helpMenuTemplate = {
6- label : 'Help' ,
7- submenu : [
8- {
9- label : 'Learn More' ,
10- click : ( ) => shell . openExternal ( 'https://github.com/chrisknepper/android-messages-desktop/' )
11- } ,
12- {
13- label : 'Changelog' ,
14- click : ( ) => shell . openExternal ( 'https://github.com/chrisknepper/android-messages-desktop/blob/master/CHANGELOG.md' )
15- }
16- ]
17- } ;
7+ const submenu = [ {
8+ label : 'Learn More' ,
9+ click : ( ) => shell . openExternal ( 'https://github.com/chrisknepper/android-messages-desktop/' )
10+ } ,
11+ {
12+ label : 'Changelog' ,
13+ click : ( ) => shell . openExternal ( 'https://github.com/chrisknepper/android-messages-desktop/blob/master/CHANGELOG.md' )
14+ }
15+ ] ;
16+
17+ if ( IS_WINDOWS ) {
18+ submenu . push ( separator ) ;
19+ submenu . push ( checkForUpdatesMenuItem ) ;
20+ }
1821
1922if ( ! IS_MAC ) {
20- helpMenuTemplate . submenu . push ( aboutMenuItem ) ;
23+ submenu . push ( separator ) ;
24+ submenu . push ( aboutMenuItem ) ;
2125}
26+
27+ export const helpMenuTemplate = {
28+ label : 'Help' ,
29+ submenu
30+ } ;
Original file line number Diff line number Diff line change 1+ export const separator = { type : 'separator' } ;
Original file line number Diff line number Diff line change 1+ export const viewMenuTemplate = {
2+ label : "View" ,
3+ submenu : [
4+ {
5+ role : "toggleFullScreen" ,
6+ } ,
7+ {
8+ role : "reload"
9+ }
10+ ]
11+ } ;
You can’t perform that action at this time.
0 commit comments