html bubbles, more simplifications, new session protocol
This commit is contained in:
parent
0c6a58ea24
commit
d3f99d6133
21 changed files with 340 additions and 169 deletions
|
|
@ -20,12 +20,29 @@ function updateWindowPosition()
|
|||
})
|
||||
}
|
||||
|
||||
// Called when a NavBar button is pressed.
|
||||
function onNavBar(_e, cmd)
|
||||
|
||||
function createPreviewWin(_e, content)
|
||||
{
|
||||
cmd === "close" ? win.close() : win.minimize();
|
||||
console.log("Creating preview window");
|
||||
|
||||
const preview = new BrowserWindow({
|
||||
width: 500,
|
||||
height: 300,
|
||||
x: null,
|
||||
y: null,
|
||||
resizable: true,
|
||||
frame: false,
|
||||
webPreferences: { preload: path.join(__dirname, "/render/preload.js") }
|
||||
});
|
||||
|
||||
preview.loadFile(path.join(__dirname, "preview.html"));
|
||||
|
||||
preview.webContents.on("did-finish-load", () => {
|
||||
preview.webContents.send("preview-init", content);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function createWin()
|
||||
{
|
||||
if (win) return;
|
||||
|
|
@ -75,7 +92,6 @@ function createWin()
|
|||
});
|
||||
}
|
||||
|
||||
ipcMain.on("nav-bar", onNavBar);
|
||||
ipcMain.on("create-win", createWin);
|
||||
ipcMain.on("preview", createPreviewWin);
|
||||
|
||||
exports.createWin = createWin;
|
||||
|
|
|
|||
Loading…
Reference in a new issue