feat: allow partial setting of window bounds (#15677)
Extend the existing win.setBounds functionality by allowing developers to partially update bounds without being forced to pass in all four bounds values. No existing functionality is altere
This commit is contained in:
parent
0c46a7a4d9
commit
c06f023313
3 changed files with 44 additions and 1 deletions
|
@ -17,6 +17,15 @@ BrowserWindow.prototype._init = function () {
|
|||
// Create WebContentsView.
|
||||
this.setContentView(new WebContentsView(this.webContents))
|
||||
|
||||
const nativeSetBounds = this.setBounds
|
||||
this.setBounds = (bounds, ...opts) => {
|
||||
bounds = {
|
||||
...this.getBounds(),
|
||||
...bounds
|
||||
}
|
||||
nativeSetBounds.call(this, bounds, ...opts)
|
||||
}
|
||||
|
||||
// Make new windows requested by links behave like "window.open"
|
||||
this.webContents.on('-new-window', (event, url, frameName, disposition,
|
||||
additionalFeatures, postData,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue