mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-17 13:13:49 +01:00
BUGFIX: Fix wrong zoom factor in Electron app (#1245)
This commit is contained in:
parent
478646290e
commit
a79d7f9e45
@ -44,6 +44,9 @@ async function createWindow(killall) {
|
|||||||
window.removeMenu();
|
window.removeMenu();
|
||||||
noScripts = killall ? { query: { noScripts: killall } } : {};
|
noScripts = killall ? { query: { noScripts: killall } } : {};
|
||||||
window.loadFile("index.html", noScripts);
|
window.loadFile("index.html", noScripts);
|
||||||
|
window.once("ready-to-show", () => {
|
||||||
|
utils.setZoomFactor(window, utils.getZoomFactor());
|
||||||
|
});
|
||||||
window.show();
|
window.show();
|
||||||
if (debug) window.webContents.openDevTools();
|
if (debug) window.webContents.openDevTools();
|
||||||
|
|
||||||
@ -60,7 +63,6 @@ async function createWindow(killall) {
|
|||||||
|
|
||||||
achievements.enableAchievementsInterval(window);
|
achievements.enableAchievementsInterval(window);
|
||||||
utils.attachUnresponsiveAppHandler(window);
|
utils.attachUnresponsiveAppHandler(window);
|
||||||
utils.setZoomFactor(window);
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await api.initialize(window);
|
await api.initialize(window);
|
||||||
|
@ -212,7 +212,7 @@ function getMenu(window) {
|
|||||||
click: () => window.loadFile("index.html"),
|
click: () => window.loadFile("index.html"),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: "Reload & Kill All Scripts",
|
label: "Reload && Kill All Scripts",
|
||||||
click: () => utils.reloadAndKill(window, true),
|
click: () => utils.reloadAndKill(window, true),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
@ -7,8 +7,12 @@ const store = new Store();
|
|||||||
|
|
||||||
function reloadAndKill(window, killScripts) {
|
function reloadAndKill(window, killScripts) {
|
||||||
log.info("Reloading & Killing all scripts...");
|
log.info("Reloading & Killing all scripts...");
|
||||||
|
const zoomFactor = getZoomFactor();
|
||||||
window.webContents.forcefullyCrashRenderer();
|
window.webContents.forcefullyCrashRenderer();
|
||||||
window.loadFile("index.html", killScripts ? { query: { noScripts: true } } : {});
|
window.loadFile("index.html", killScripts ? { query: { noScripts: true } } : {});
|
||||||
|
window.once("ready-to-show", () => {
|
||||||
|
setZoomFactor(window, zoomFactor);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function promptForReload(window) {
|
function promptForReload(window) {
|
||||||
|
Loading…
Reference in New Issue
Block a user