Skip to content

Commit

Permalink
Show tip after enabling Auto Hide Menu Bar (#1125)
Browse files Browse the repository at this point in the history
Co-authored-by: Sindre Sorhus <[email protected]>
  • Loading branch information
hiteda and sindresorhus committed Oct 20, 2019
1 parent db85ce4 commit 76ac982
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion source/menu.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as path from 'path';
import {existsSync, writeFileSync} from 'fs';
import {app, shell, Menu, MenuItemConstructorOptions, BrowserWindow} from 'electron';
import {app, shell, Menu, MenuItemConstructorOptions, BrowserWindow, dialog} from 'electron';
import {
is,
appMenu,
Expand Down Expand Up @@ -262,6 +262,14 @@ Press Command/Ctrl+R in Caprine to see your changes.
config.set('autoHideMenuBar', menuItem.checked);
focusedWindow.setAutoHideMenuBar(menuItem.checked);
focusedWindow.setMenuBarVisibility(!menuItem.checked);

if (menuItem.checked) {
dialog.showMessageBox({
type: 'info',
message: 'Press the Alt key to toggle the menu bar.',
buttons: ['OK']
});
}
}
},
{
Expand Down

0 comments on commit 76ac982

Please sign in to comment.