From 8a469b0d41a753ec127df73f824bcc2e467d2f94 Mon Sep 17 00:00:00 2001 From: "Scott E. Graves" Date: Sun, 16 Dec 2018 00:06:07 -0600 Subject: [PATCH] OS X changes --- electron.js | 38 ++++++++++++++++++-------------------- public/logo_both_mac.png | Bin 0 -> 269 bytes public/logo_mac.png | Bin 0 -> 265 bytes src/index.js | 3 ++- 4 files changed, 20 insertions(+), 21 deletions(-) create mode 100644 public/logo_both_mac.png create mode 100644 public/logo_mac.png diff --git a/electron.js b/electron.js index 167ba62..3a7af3c 100644 --- a/electron.js +++ b/electron.js @@ -37,9 +37,9 @@ function createWindow() { loadUiSettings(); // Create the browser window. - const height = (process.env.ELECTRON_START_URL ? 364 : 344) - ((os.platform() === 'win32') || (os.platform() === 'darwin') ? 0 : 20); + const height = (process.env.ELECTRON_START_URL ? 364 : 344) - ((os.platform() === 'win32') ? 0 : 20); mainWindow = new BrowserWindow({ - width: 428 + (os.platform() === 'win32' ? 0 : 160), + width: 428 + ((os.platform() === 'win32') ? 0 : (os.platform() === 'darwin') ? 150 : 160), height: height, resizable: false, show: !launchHidden, @@ -83,7 +83,7 @@ function createWindow() { path: appPath, }); - const image = nativeImage.createFromPath(path.join(__dirname, (os.platform() === 'darwin') ? '/build/icon.icns' : '/build/logo.png')); + const image = nativeImage.createFromPath(path.join(__dirname, (os.platform() === 'darwin') ? '/build/logo_mac.png' : '/build/logo.png')); trayContextMenu = Menu.buildFromTemplate([ { label: 'Visible', type: 'checkbox', click(item) { @@ -373,25 +373,23 @@ ipcMain.on(Constants.IPC_Detect_Mounts, (event, data) => { }; const setImage = (locations) => { - if (os.platform() === 'win32' || os.platform() === 'linux') { - let driveInUse; - if (Object.keys(locations).length > 0) { - for (const provider of Constants.PROVIDER_LIST) { - driveInUse = locations[provider].length > 0; - if (driveInUse) - break; - } + let driveInUse; + if (Object.keys(locations).length > 0) { + for (const provider of Constants.PROVIDER_LIST) { + driveInUse = locations[provider].length > 0; + if (driveInUse) + break; } - - let image; - if (driveInUse) { - image = nativeImage.createFromPath(path.join(__dirname, '/build/logo_both.png')); - } else { - image = nativeImage.createFromPath(path.join(__dirname, '/build/logo.png')); - } - - mainWindowTray.setImage(image); } + + let image; + if (driveInUse) { + image = nativeImage.createFromPath(path.join(__dirname, os.platform() === 'darwin' ? '/build/logo_both_mac.png' : '/build/logo_both.png')); + } else { + image = nativeImage.createFromPath(path.join(__dirname, os.platform() === 'darwin' ? '/build/logo_mac.png' : '/build/logo.png')); + } + + mainWindowTray.setImage(image); }; const dataDirectory = helpers.resolvePath(data.Directory); diff --git a/public/logo_both_mac.png b/public/logo_both_mac.png new file mode 100644 index 0000000000000000000000000000000000000000..849bbb1da2dd7dd86554d390e8ab6bc9db23af5e GIT binary patch literal 269 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjS3F%DLp(Z@6C}(Ilov~d-&@h&IO;-no|`Lmpb?94#m%*-qtcjmwWk8P}s&$(G1ofC=gvktBiHrIQlaJ%V3 za;wwE^se||+ez-a2_2Tf4$<66{?9ay&C~Nc-2V97lhYG(8G)uGzgQKJ*7PG_okpaX z%Ur!L{r16s6#w~f8deBQb3J^Z=`t%{VR~0z0PB3+b%&;PwW%>Mh#1ZPWqZtY8PIzopr0B6f+tpET3 literal 0 HcmV?d00001 diff --git a/public/logo_mac.png b/public/logo_mac.png new file mode 100644 index 0000000000000000000000000000000000000000..0836d8ec3f5d99ce02fa6155a6507a0109cf5498 GIT binary patch literal 265 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`Gj7d%}YLp(Z@6C}(In7`!-&-fQ= znf2hnsn>@j#9XG`&_hT*v87p`kXcC)VsJo-Tmdl;(aT3+;-f?y0A68 zb)E|(N5Aa!yPn)<_iMXvW98xD=~=jN^$gBOcWy6A zi4+K}yKTSh&pY;{4-a&@+xD>vs&1DBnk~1GOK*R8tF9=oF9Sp0{9RV6ks`lbP0l+XkK0D5j! literal 0 HcmV?d00001 diff --git a/src/index.js b/src/index.js index 6ada234..62b9876 100644 --- a/src/index.js +++ b/src/index.js @@ -11,10 +11,11 @@ if (!process.versions.hasOwnProperty('electron')) { const ipcRenderer = ((window && window.require) ? window.require('electron').ipcRenderer : null); if (ipcRenderer) { ipcRenderer.on(Constants.IPC_Get_Platform_Reply, (event, arg) => { - if (arg.data !== 'win32') { + if (arg.data === 'linux') { let root = document.documentElement; root.style.setProperty('--default_font_size', '4.8vmin'); } + ReactDOM.render(, document.getElementById('root')); registerServiceWorker(); });