diff options
author | 2019-10-18 20:15:56 +0200 | |
---|---|---|
committer | 2019-10-18 20:15:56 +0200 | |
commit | d443bca3c82230dd6b9c59d55fbde01a051a6ab5 (patch) | |
tree | 68751f48cc2ed70d0e78a1f5bb102ee9daedd334 /src/index.js | |
parent | Fix lint (diff) | |
parent | Fix lint (diff) | |
download | ferdium-app-d443bca3c82230dd6b9c59d55fbde01a051a6ab5.tar.gz ferdium-app-d443bca3c82230dd6b9c59d55fbde01a051a6ab5.tar.zst ferdium-app-d443bca3c82230dd6b9c59d55fbde01a051a6ab5.zip |
Merge branch 'develop' into local-server
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/index.js b/src/index.js index 338a8e795..7a0e89285 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -10,10 +10,10 @@ import path from 'path'; | |||
10 | import windowStateKeeper from 'electron-window-state'; | 10 | import windowStateKeeper from 'electron-window-state'; |
11 | 11 | ||
12 | // Set app directory before loading user modules | 12 | // Set app directory before loading user modules |
13 | if (process.env.FERDI_APPDATA_DIR != null) { | 13 | if (process.env.FERDI_APPDATA_DIR || process.env.PORTABLE_EXECUTABLE_DIR) { |
14 | app.setPath('appData', process.env.FERDI_APPDATA_DIR); | 14 | const appDataPath = process.env.FERDI_APPDATA_DIR || process.env.PORTABLE_EXECUTABLE_DIR; |
15 | } else if (process.env.PORTABLE_EXECUTABLE_DIR != null) { | 15 | app.setPath('appData', appDataPath); |
16 | app.setPath('appData', process.env.PORTABLE_EXECUTABLE_DIR); | 16 | app.setPath('userData', path.join(app.getPath('appData'), app.getName())); |
17 | } | 17 | } |
18 | if (isDevMode) { | 18 | if (isDevMode) { |
19 | app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}Dev`)); | 19 | app.setPath('userData', path.join(app.getPath('appData'), `${app.getName()}Dev`)); |
@@ -147,6 +147,13 @@ const createWindow = () => { | |||
147 | } | 147 | } |
148 | 148 | ||
149 | // Create the browser window. | 149 | // Create the browser window. |
150 | let backgroundColor = '#7367F0'; | ||
151 | if (settings.get('accentColor') !== '#7367f0') { | ||
152 | backgroundColor = settings.get('accentColor'); | ||
153 | } else if (settings.get('darkMode')) { | ||
154 | backgroundColor = '#1E1E1E'; | ||
155 | } | ||
156 | |||
150 | mainWindow = new BrowserWindow({ | 157 | mainWindow = new BrowserWindow({ |
151 | x: posX, | 158 | x: posX, |
152 | y: posY, | 159 | y: posY, |
@@ -156,7 +163,7 @@ const createWindow = () => { | |||
156 | minHeight: 500, | 163 | minHeight: 500, |
157 | titleBarStyle: isMac ? 'hidden' : '', | 164 | titleBarStyle: isMac ? 'hidden' : '', |
158 | frame: isLinux, | 165 | frame: isLinux, |
159 | backgroundColor: !settings.get('darkMode') ? '#7367F0' : '#1E1E1E', | 166 | backgroundColor, |
160 | webPreferences: { | 167 | webPreferences: { |
161 | nodeIntegration: true, | 168 | nodeIntegration: true, |
162 | webviewTag: true, | 169 | webviewTag: true, |