This commit is contained in:
Artur Mustafin
2019-08-21 06:43:56 +03:00
parent 9278402d65
commit bd99da560b
3 changed files with 15 additions and 0 deletions

View File

@@ -1939,6 +1939,14 @@ namespace ElectronNET.API
});
}
/// <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

View File

@@ -440,6 +440,9 @@ module.exports = (socket, 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) {

View File

@@ -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) {