Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* fix: menu visibility should not be overwritten on startup * fix: removing menu for window without global menubar * test: setMenu tests are not for mac
- Loading branch information
Showing
7 changed files
with
88 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const { app, BrowserWindow } = require('electron') | ||
|
||
let win | ||
app.on('ready', function () { | ||
win = new BrowserWindow({}) | ||
win.loadURL('about:blank') | ||
win.setMenu(null) | ||
|
||
setTimeout(() => { | ||
if (win.isMenuBarVisible()) { | ||
console.log('Window has a menu') | ||
} else { | ||
console.log('Window has no menu') | ||
} | ||
app.quit() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "electron-test-menu", | ||
"main": "main.js" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const { app, BrowserWindow } = require('electron') | ||
|
||
let win | ||
app.on('ready', function () { | ||
win = new BrowserWindow({}) | ||
win.loadURL('about:blank') | ||
win.setMenuBarVisibility(false) | ||
|
||
setTimeout(() => { | ||
if (win.isMenuBarVisible()) { | ||
console.log('Window has a menu') | ||
} else { | ||
console.log('Window has no menu') | ||
} | ||
app.quit() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"name": "electron-test-menu", | ||
"main": "main.js" | ||
} |