Don't show more than a single about window
This commit is contained in:
parent
4f845f58a9
commit
a632ecde33
2 changed files with 8 additions and 5 deletions
|
|
@ -9,6 +9,12 @@ export let aboutWindow: BrowserWindow;
|
||||||
|
|
||||||
// Create our about window
|
// Create our about window
|
||||||
export function createAboutWindow() {
|
export function createAboutWindow() {
|
||||||
|
// If our about window already exists, show it
|
||||||
|
if (aboutWindow) {
|
||||||
|
aboutWindow.show();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
aboutWindow = new BrowserWindow({
|
aboutWindow = new BrowserWindow({
|
||||||
minWidth: 300,
|
minWidth: 300,
|
||||||
minHeight: 300,
|
minHeight: 300,
|
||||||
|
|
@ -30,6 +36,7 @@ export function createAboutWindow() {
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Remove the default menu
|
||||||
aboutWindow.setMenu(null);
|
aboutWindow.setMenu(null);
|
||||||
|
|
||||||
aboutWindow.loadFile(join(__dirname, "about.html"));
|
aboutWindow.loadFile(join(__dirname, "about.html"));
|
||||||
|
|
|
||||||
|
|
@ -148,11 +148,7 @@ export function createMainWindow() {
|
||||||
mainWindow.webContents.setZoomLevel(0);
|
mainWindow.webContents.setZoomLevel(0);
|
||||||
} else if (input.key === "F1") {
|
} else if (input.key === "F1") {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
if (!aboutWindow) {
|
|
||||||
createAboutWindow();
|
createAboutWindow();
|
||||||
} else {
|
|
||||||
aboutWindow.show();
|
|
||||||
}
|
|
||||||
} else if (
|
} else if (
|
||||||
input.key === "F5" ||
|
input.key === "F5" ||
|
||||||
((input.control || input.meta) && input.key.toLowerCase() === "r")
|
((input.control || input.meta) && input.key.toLowerCase() === "r")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue