Newer
Older
Luke Schoen
committed
// Copyright 2015-2018 Parity Technologies (UK) Ltd.
// This file is part of Parity.
//
// SPDX-License-Identifier: BSD-3-Clause
import path from 'path';
import url from 'url';
import staticPath from '../../utils/staticPath';
const INDEX_HTML_PATH =
process.env.ELECTRON_START_URL ||
url.format({
pathname: path.join(staticPath, 'build', 'index.html'),
protocol: 'file:',
slashes: true
});
// Icon path differs when started with `yarn electron` or `yarn start`
const ICON_PATH =
process.platform === 'win32'
? path.join(staticPath, 'assets', 'icons', 'win', 'icon.ico')
: path.join(staticPath, 'assets', 'icons', 'iconTemplate.png');
Luke Schoen
committed
Luke Schoen
committed
const ICON_DOCK_PATH =
process.platform === 'darwin'
? path.join(staticPath, 'assets', 'icons', 'iconDock.png')
: '';
Luke Schoen
committed
const shouldUseDevTools = process.env.NODE_ENV !== 'production';
Luke Schoen
committed
const windowPosition =
process.platform === 'win32' ? 'trayBottomCenter' : 'trayCenter';
Luke Schoen
committed
// API docs: https://electronjs.org/docs/api/browser-window
Luke Schoen
committed
const DEFAULT_OPTIONS = {
Luke Schoen
committed
frame: true,
height: 640,
Luke Schoen
committed
iconDock: ICON_DOCK_PATH,
Luke Schoen
committed
index: INDEX_HTML_PATH,
resizable: false,
show: false, // Run showWindow later
showDockIcon: true, // macOS usage only
Luke Schoen
committed
tabbingIdentifier: 'parity',
Luke Schoen
committed
webPreferences: {
Luke Schoen
committed
devTools: shouldUseDevTools, // Security
enableRemoteModule: false
Luke Schoen
committed
},
width: 360,
windowPosition: windowPosition, // Required
Luke Schoen
committed
withTaskbar: false
};
const TASKBAR_OPTIONS = {
Luke Schoen
committed
height: 464,
Luke Schoen
committed
// On Linux the user must click the tray icon and then click the tooltip
// to toggle the Fether window open/close
tooltip: 'Click to toggle Fether window',
Luke Schoen
committed
width: 352,
withTaskbar: true
};
export { DEFAULT_OPTIONS, TASKBAR_OPTIONS };