Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ElectronNET.API/BrowserWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1939,6 +1939,14 @@ public void SetMenu(MenuItem[] menuItems)
});
}

/// <summary>
/// Remove the window's menu bar.
/// </summary>
public void RemoveMenu()
{
BridgeConnector.Socket.Emit("browserWindowRemoveMenu", Id);
}

/// <summary>
/// Sets progress value in progress bar. Valid range is [0, 1.0]. Remove progress
/// bar when progress smaler as 0; Change to indeterminate mode when progress bigger as 1. On Linux
Expand Down
3 changes: 3 additions & 0 deletions ElectronNET.Host/api/browserWindows.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions ElectronNET.Host/api/browserWindows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,10 @@ export = (socket: SocketIO.Socket, app: Electron.App) => {
getWindowById(id).setMenu(menu);
});

socket.on('browserWindowRemoveMenu', (id) => {
getWindowById(id).removeMenu();
});

function addMenuItemClickConnector(menuItems, callback) {
menuItems.forEach((item) => {
if (item.submenu && item.submenu.items.length > 0) {
Expand Down