Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
Merge branch test/desktop-init into branch feature/realm
Browse files Browse the repository at this point in the history
  • Loading branch information
laumair committed Dec 20, 2018
2 parents c888501 + 9e6ce6d commit 40f5091
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions src/desktop/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import electronSettings from 'electron-settings';
import path from 'path';
import URL from 'url';
import fs from 'fs';
import Themes from 'themes/themes';

import { initMenu, contextMenu } from './native/Menu.js';

Expand Down Expand Up @@ -106,12 +105,6 @@ function createWindow() {
});
} catch (error) {}

let bgColor = (settings.themeName && Themes[settings.themeName].body.bg) || 'rgb(3, 41, 62)';

if (bgColor.indexOf('rgb') === 0) {
bgColor = bgColor.match(/[0-9]+/g).reduce((a, b) => a + (b | 256).toString(16).slice(1), '#');
}

/**
* Initialize the main wallet window
*/
Expand All @@ -122,12 +115,12 @@ function createWindow() {
y: windowState.y,
minWidth: 500,
minHeight: 720,
show: false,
frame: process.platform === 'linux',
titleBarStyle: 'hidden',
icon: `${paths.assets}icon.${
process.platform === 'win32' ? 'ico' : process.platform === 'darwin' ? 'icns' : 'png'
}`,
backgroundColor: bgColor,
webPreferences: {
nodeIntegration: false,
preload: path.resolve(paths.preload, devMode ? 'preloadDev.js' : 'preloadProd.js'),
Expand All @@ -144,7 +137,6 @@ function createWindow() {
fullscreenable: false,
resizable: false,
transparent: true,
backgroundColor: bgColor,
show: false,
webPreferences: {
nodeIntegration: false,
Expand Down Expand Up @@ -408,13 +400,15 @@ ipc.on('menu.update', (e, payload) => {
});

/**
* Proxy focus event from tray to main window
* Proxy main window focus
*/
ipc.on('window.focus', (e, payload) => {
if (windows.main) {
windows.main.show();
windows.main.focus();
windows.main.webContents.send('menu', payload);
if (payload) {
windows.main.webContents.send('menu', payload);
}
}
});

Expand Down

0 comments on commit 40f5091

Please sign in to comment.