OS X changes

This commit is contained in:
Scott E. Graves
2018-12-16 00:06:07 -06:00
parent d5595e4c92
commit 8a469b0d41
4 changed files with 20 additions and 21 deletions

View File

@@ -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,7 +373,6 @@ 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) {
@@ -385,13 +384,12 @@ ipcMain.on(Constants.IPC_Detect_Mounts, (event, data) => {
let image;
if (driveInUse) {
image = nativeImage.createFromPath(path.join(__dirname, '/build/logo_both.png'));
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, '/build/logo.png'));
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);

BIN
public/logo_both_mac.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

BIN
public/logo_mac.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 265 B

View File

@@ -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(<App platform={arg.data} version={packageJson.version}/>, document.getElementById('root'));
registerServiceWorker();
});