22 lines
647 B
JavaScript
22 lines
647 B
JavaScript
// All of the Node.js APIs are available in the preload process.
|
|
// It has the same sandbox as a Chrome extension.
|
|
const { Titlebar, Color } = require('custom-electron-titlebar');
|
|
const path = require('path');
|
|
|
|
let titlebar
|
|
|
|
window.addEventListener('DOMContentLoaded', () => {
|
|
titlebar = new Titlebar({
|
|
backgroundColor: Color.fromHex("#FFFFFF"),
|
|
itemBackgroundColor: Color.fromHex("#FFFFFF"),
|
|
//svgColor: Color.WHITE
|
|
icon: path.join(__dirname, '../images', '/icon.jpg')
|
|
//menu: null // = do not automatically use Menu.applicationMenu
|
|
})
|
|
|
|
|
|
})
|
|
|
|
function changeTitlebar(hex){
|
|
titlebar.updateBackground(Color.fromHex(hex));
|
|
} |