Skip to content

Commit 5157561

Browse files
Merge pull request #303 from hack2root/master
fix issue #301
2 parents bbecd86 + bd99da5 commit 5157561

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

ElectronNET.API/BrowserWindow.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1939,6 +1939,14 @@ public void SetMenu(MenuItem[] menuItems)
19391939
});
19401940
}
19411941

1942+
/// <summary>
1943+
/// Remove the window's menu bar.
1944+
/// </summary>
1945+
public void RemoveMenu()
1946+
{
1947+
BridgeConnector.Socket.Emit("browserWindowRemoveMenu", Id);
1948+
}
1949+
19421950
/// <summary>
19431951
/// Sets progress value in progress bar. Valid range is [0, 1.0]. Remove progress
19441952
/// bar when progress smaler as 0; Change to indeterminate mode when progress bigger as 1. On Linux

ElectronNET.Host/api/browserWindows.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ElectronNET.Host/api/browserWindows.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,10 @@ export = (socket: SocketIO.Socket, app: Electron.App) => {
573573
getWindowById(id).setMenu(menu);
574574
});
575575

576+
socket.on('browserWindowRemoveMenu', (id) => {
577+
getWindowById(id).removeMenu();
578+
});
579+
576580
function addMenuItemClickConnector(menuItems, callback) {
577581
menuItems.forEach((item) => {
578582
if (item.submenu && item.submenu.items.length > 0) {

0 commit comments

Comments
 (0)