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

Add defaultX/defaultY options for setting default position of window #67

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rhysd
Copy link
Contributor

@rhysd rhysd commented Jan 29, 2021

This PR adds following options:

  • defaultX: The X position that should be returned if no file exists yet. Defaults to 0.
  • defaultY: The Y position that should be returned if no file exists yet. Defaults to 0.

Motivation of these options are that I want to specify default position of the window. This library specifies x: 0, y: 0 as default position, but default position of browser window is not (0, 0). The default position is center of screen.

These options accepts undefined because x and y options in BrowserWindow's constructor accepts undefined. When they are set to undefined, the window is aligned at center of the screen.

Note that this PR does not break current behavior because their default values are 0. I added test case for this and updated type definitions also.

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.

1 participant