mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2025-01-09 00:21:10 +00:00
parent
eb08d85830
commit
28dca8c647
@ -71,8 +71,8 @@ function createMainWindow(inpOptions, onAppQuit, setDockBadge) {
|
||||
minHeight: options.minHeight,
|
||||
maxWidth: options.maxWidth,
|
||||
maxHeight: options.maxHeight,
|
||||
x: mainWindowState.x,
|
||||
y: mainWindowState.y,
|
||||
x: options.x,
|
||||
y: options.y,
|
||||
autoHideMenuBar: !options.showMenuBar,
|
||||
// Convert dashes to spaces because on linux the app name is joined with dashes
|
||||
title: options.name,
|
||||
|
18
docs/api.md
18
docs/api.md
@ -21,6 +21,8 @@
|
||||
- [[min-height]](#min-height)
|
||||
- [[max-width]](#max-width)
|
||||
- [[max-height]](#max-height)
|
||||
- [[x]](#x)
|
||||
- [[y]](#y)
|
||||
- [[show-menu-bar]](#show-menu-bar)
|
||||
- [[fast-quit]](#fast-quit)
|
||||
- [[user-agent]](#user-agent)
|
||||
@ -229,6 +231,22 @@ Maximum width of the packaged application, default is no limit.
|
||||
|
||||
Maximum height of the packaged application, default is no limit.
|
||||
|
||||
#### [x]
|
||||
|
||||
```
|
||||
--x <value>
|
||||
```
|
||||
|
||||
X location of the packaged application window.
|
||||
|
||||
#### [y]
|
||||
|
||||
```
|
||||
--y <value>
|
||||
```
|
||||
|
||||
Y location of the packaged application window.
|
||||
|
||||
#### [show-menu-bar]
|
||||
|
||||
```
|
||||
|
@ -21,6 +21,8 @@ function selectAppArgs(options) {
|
||||
minHeight: options.minHeight,
|
||||
maxWidth: options.maxWidth,
|
||||
maxHeight: options.maxHeight,
|
||||
x: options.x,
|
||||
y: options.y,
|
||||
showMenuBar: options.showMenuBar,
|
||||
fastQuit: options.fastQuit,
|
||||
userAgent: options.userAgent,
|
||||
|
@ -60,6 +60,8 @@ if (require.main === module) {
|
||||
.option('--min-height <value>', 'set window minimum height, defaults to 0px', parseInt)
|
||||
.option('--max-width <value>', 'set window maximum width, default is no limit', parseInt)
|
||||
.option('--max-height <value>', 'set window maximum height, default is no limit', parseInt)
|
||||
.option('--x <value>', 'set window x location', parseInt)
|
||||
.option('--y <value>', 'set window y location', parseInt)
|
||||
.option('-m, --show-menu-bar', 'set menu bar visible, defaults to false')
|
||||
.option('-f, --fast-quit', 'quit app after window close (OSX only), defaults to false')
|
||||
.option('-u, --user-agent <value>', 'set the user agent string for the app')
|
||||
|
@ -101,5 +101,13 @@ export default function (inpOptions) {
|
||||
options.height = options.maxHeight;
|
||||
}
|
||||
|
||||
if (typeof inpOptions.x !== 'undefined') {
|
||||
options.x = inpOptions.x;
|
||||
}
|
||||
|
||||
if (typeof inpOptions.y !== 'undefined') {
|
||||
options.y = inpOptions.y;
|
||||
}
|
||||
|
||||
return asyncConfig(options);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user