mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-09-24 07:54:43 +00:00
merge #673
This commit is contained in:
@@ -155,8 +155,8 @@ namespace ElectronNET.API.Entities
|
||||
public bool? Frame { get; set; } = true;
|
||||
|
||||
/// <summary>
|
||||
/// Whether this is a modal window. This only works when the window is a child
|
||||
/// window.Default is false.
|
||||
/// Whether this is a modal window. This only works when <see cref="Parent"/> is
|
||||
/// also specified. Default is false.
|
||||
/// </summary>
|
||||
public bool? Modal { get; set; }
|
||||
|
||||
@@ -281,6 +281,12 @@ namespace ElectronNET.API.Entities
|
||||
public string ProxyCredentials { get; set; }
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// The window to use as the created window's parent.
|
||||
/// </summary>
|
||||
[DefaultValue(null)]
|
||||
public BrowserWindow Parent { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Set a custom position for the traffic light buttons in frameless windows.
|
||||
/// </summary>
|
||||
|
||||
@@ -187,6 +187,9 @@ module.exports = (socket, app, firstTime) => {
|
||||
else if (!options.webPreferences) {
|
||||
options = { ...options, webPreferences: { nodeIntegration: true, contextIsolation: false } };
|
||||
}
|
||||
if (options.parent) {
|
||||
options.parent = electron_1.BrowserWindow.fromId(options.parent.id);
|
||||
}
|
||||
if (options.x && options.y && options.x == 0 && options.y == 0) {
|
||||
delete options.x;
|
||||
delete options.y;
|
||||
|
||||
@@ -222,6 +222,10 @@ export = (socket: Socket, app: Electron.App, firstTime: boolean) => {
|
||||
options = {...options, webPreferences: {nodeIntegration: true, contextIsolation: false}};
|
||||
}
|
||||
|
||||
if (options.parent) {
|
||||
options.parent = BrowserWindow.fromId(options.parent.id);
|
||||
}
|
||||
|
||||
if (options.x && options.y && options.x == 0 && options.y == 0) {
|
||||
delete options.x;
|
||||
delete options.y;
|
||||
|
||||
Reference in New Issue
Block a user