theme: apply theme's bg color to electron window

This commit is contained in:
jean-emmanuel 2017-06-21 20:35:01 +02:00
parent 1f865544d8
commit 2156bdbce3

View file

@ -3,6 +3,10 @@ var path = require('path'),
shortcut = require('electron-localshortcut'),
settings = require('./settings')
var bgColor = settings.read('theme') && settings.read('theme').indexOf('--color-bg:') != -1 ?
settings.read('theme').match(/--color-bg:([^;]*);/)[1].trim()
: '#191f2a'
module.exports = function(options={}) {
var window
@ -11,7 +15,7 @@ module.exports = function(options={}) {
width: options.width || 800,
height: options.height || 600,
title: options.title || settings.read('appName'),
backgroundColor:'#191f2a',
backgroundColor: bgColor,
type:options.type
})