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
|
||||
export function createAboutWindow() {
|
||||
// If our about window already exists, show it
|
||||
if (aboutWindow) {
|
||||
aboutWindow.show();
|
||||
return;
|
||||
}
|
||||
|
||||
aboutWindow = new BrowserWindow({
|
||||
minWidth: 300,
|
||||
minHeight: 300,
|
||||
|
|
@ -30,6 +36,7 @@ export function createAboutWindow() {
|
|||
},
|
||||
});
|
||||
|
||||
// Remove the default menu
|
||||
aboutWindow.setMenu(null);
|
||||
|
||||
aboutWindow.loadFile(join(__dirname, "about.html"));
|
||||
|
|
|
|||
|
|
@ -148,11 +148,7 @@ export function createMainWindow() {
|
|||
mainWindow.webContents.setZoomLevel(0);
|
||||
} else if (input.key === "F1") {
|
||||
event.preventDefault();
|
||||
if (!aboutWindow) {
|
||||
createAboutWindow();
|
||||
} else {
|
||||
aboutWindow.show();
|
||||
}
|
||||
} else if (
|
||||
input.key === "F5" ||
|
||||
((input.control || input.meta) && input.key.toLowerCase() === "r")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue