mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-05-17 15:30:53 +00:00
fix issue #301
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user