Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove now-native setWindowBounds functionality #15

Merged
merged 2 commits into from Jun 6, 2019
Merged

Remove now-native setWindowBounds functionality #15

merged 2 commits into from Jun 6, 2019

Conversation

codebytere
Copy link
Contributor

This PR removes the setWindowBounds utility function, as it's natively available in Electron starting with v4.0.0 as a result of this PR.

@sindresorhus
Copy link
Owner

You also need to update

exports.setWindowBounds(bounds, options);
to use the native method.

@sindresorhus
Copy link
Owner

And

electron-util/index.d.ts

Lines 215 to 237 in e7b9fe0

export interface SetWindowBoundsOptions {
/**
The window to set the bounds of.
Default: Current window
*/
readonly window?: BrowserWindow;
/**
Animate the change.
@default false
*/
readonly animated?: boolean;
}
/**
Set the bounds of a window. This is similar to the [`BrowserWindow#setBounds()`](https://electronjs.org/docs/api/browser-window#winsetboundsbounds-animate) method, but it allows setting any of the `x`, `y`, `width`, `height` properties, instead of forcing you to set them all at once.
The properties that are not set will just fall back to the current ones.
@param bounds - New window bounds.
*/
export function setWindowBounds(bounds: OptionalRectangle, options?: SetWindowBoundsOptions): void;

@sindresorhus sindresorhus merged commit 88ac9fe into sindresorhus:master Jun 6, 2019
@codebytere codebytere deleted the remove-setWindowBounds branch June 6, 2019 17:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants