I'got an issue with my application. I've created a nice looking Login-Window which is a window with the options {transparent: true, frame: false}.
After the user has logged in. I want to "redirect" to the Dashboard where I need to set the option "transparent" back to false because the background of the Dashboard is white and Im only able to the printed font on a fully transparent window.
Is there any workaround to get the Electronwindow back to none transparent without recreating it.
app.js:
const electron = require('electron');
const { BrowserWindow } = electron;
const { app } = electron;
const window = require('electron-window');
const { MainProcess } = require("./modules/ipcHelper.js");
const io = require('socket.io-client');
const port = 8888;
let socket;
require('electron-reload')(__dirname)
let mainWindow;
app.on('ready', () => {
mainWindow = window.createWindow({
width: 835,
height: 750,
frame: false,
transparent: true,
});
let testwindow = new BrowserWindow({
width: 835,
height: 750,
frame: false,
transparent: true,
});
mainWindow.showUrl(`./app/index.html`, () => {
});
let mainProcess = MainProcess(mainWindow);
mainProcess.onReady(() => {
mainProcess.on('auth', (arg, callback) => {
socket = io('http://' + arg.servername + ':' + port);
socket.on("connect", () => {
socket.emit('auth', { username: arg.username, password: arg.password }, (response) => {
if (response.success === true){
callback({ success: true });
//Here i want to set transparenty back to false
}
else
callback({ success: false, code: response.code });
});
});
socket.on("connect_error",() => {
callback({ success: false, code: 3 });
});
});
});
})