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 0000000..849bbb1 Binary files /dev/null and b/public/logo_both_mac.png differ diff --git a/public/logo_mac.png b/public/logo_mac.png new file mode 100644 index 0000000..0836d8e Binary files /dev/null and b/public/logo_mac.png differ 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(); });