mirror of
https://github.com/Llewellynvdm/nativefier.git
synced 2024-11-11 07:41:04 +00:00
Adds a `--background-color` flag for the background of the window when the app isn't loaded.
This commit is contained in:
parent
5433569921
commit
81c422d4e0
@ -125,6 +125,7 @@ function createMainWindow(inpOptions, onAppQuit, setDockBadge) {
|
||||
alwaysOnTop: options.alwaysOnTop,
|
||||
titleBarStyle: options.titleBarStyle,
|
||||
show: options.tray !== 'start-in-tray',
|
||||
backgroundColor: options.backgroundColor,
|
||||
},
|
||||
DEFAULT_WINDOW_OPTIONS,
|
||||
),
|
||||
|
@ -65,6 +65,7 @@
|
||||
- [[always-on-top]](#always-on-top)
|
||||
- [[global-shortcuts]](#global-shortcuts)
|
||||
- [[darwin-dark-mode-support]](#darwin-dark-mode-support)
|
||||
- [[background-color]](#background-color)
|
||||
- [Programmatic API](#programmatic-api)
|
||||
- [Addition packaging options for Windows](#addition-packaging-options-for-windows)
|
||||
- [[version-string]](#version-string)
|
||||
@ -703,6 +704,14 @@ Example `shortcuts.json` for `https://deezer.com` & `https://soundcloud.com` to
|
||||
|
||||
Enables Dark Mode support on macOS 10.4+.
|
||||
|
||||
#### [background-color]
|
||||
|
||||
```
|
||||
--background-color
|
||||
```
|
||||
|
||||
See https://electronjs.org/docs/api/browser-window#setting-backgroundcolor
|
||||
|
||||
## Programmatic API
|
||||
|
||||
You can use the Nativefier programmatic API as well.
|
||||
|
@ -58,6 +58,7 @@ function selectAppArgs(options) {
|
||||
alwaysOnTop: options.alwaysOnTop,
|
||||
titleBarStyle: options.titleBarStyle,
|
||||
globalShortcuts: options.globalShortcuts,
|
||||
backgroundColor: options.backgroundColor,
|
||||
darwinDarkModeSupport: options.darwinDarkModeSupport,
|
||||
};
|
||||
}
|
||||
@ -134,6 +135,7 @@ function changeAppPackageJsonName(appPath, name, url) {
|
||||
*/
|
||||
function buildApp(src, dest, options, callback) {
|
||||
const appArgs = selectAppArgs(options);
|
||||
|
||||
copy(src, dest, (error) => {
|
||||
if (error) {
|
||||
callback(`Error Copying temporary directory: ${error}`);
|
||||
|
@ -238,6 +238,10 @@ if (require.main === module) {
|
||||
'--global-shortcuts <value>',
|
||||
'JSON file with global shortcut configuration. See https://github.com/jiahaog/nativefier/blob/master/docs/api.md#global-shortcuts',
|
||||
)
|
||||
.option(
|
||||
'--background-color <value>',
|
||||
"Sets the background color (for seamless experience while the app is loading). Example value: '#2e2c29'",
|
||||
)
|
||||
.option(
|
||||
'--darwin-dark-mode-support',
|
||||
'(macOS only) enable Dark Mode support on macOS 10.14+',
|
||||
|
@ -77,6 +77,7 @@ export default function(inpOptions) {
|
||||
alwaysOnTop: inpOptions.alwaysOnTop || false,
|
||||
titleBarStyle: inpOptions.titleBarStyle || null,
|
||||
globalShortcuts: inpOptions.globalShortcuts || null,
|
||||
backgroundColor: inpOptions.backgroundColor || null,
|
||||
darwinDarkModeSupport: inpOptions.darwinDarkModeSupport || false,
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user