mirror of
https://github.com/balena-io/etcher.git
synced 2025-05-02 19:18:41 +00:00
Fix zoomFactor in webviews
Change-type: patch Signed-off-by: Lorenzo Alberto Maria Ambrosi <lorenzothunder.ambrosi@gmail.com>
This commit is contained in:
parent
6584cef774
commit
06a96db72d
@ -356,6 +356,16 @@ async function main() {
|
|||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
React.createElement(MainPage),
|
React.createElement(MainPage),
|
||||||
document.getElementById('main'),
|
document.getElementById('main'),
|
||||||
|
// callback to set the correct zoomFactor for webviews as well
|
||||||
|
async () => {
|
||||||
|
const fullscreen = await settings.get('fullscreen');
|
||||||
|
const width = fullscreen ? window.screen.width : window.outerWidth;
|
||||||
|
try {
|
||||||
|
electron.webFrame.setZoomFactor(width / settings.DEFAULT_WIDTH);
|
||||||
|
} catch (err) {
|
||||||
|
// noop
|
||||||
|
}
|
||||||
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,6 +26,9 @@ const debug = _debug('etcher:models:settings');
|
|||||||
|
|
||||||
const JSON_INDENT = 2;
|
const JSON_INDENT = 2;
|
||||||
|
|
||||||
|
export const DEFAULT_WIDTH = 800;
|
||||||
|
export const DEFAULT_HEIGHT = 480;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @summary Userdata directory path
|
* @summary Userdata directory path
|
||||||
* @description
|
* @description
|
||||||
|
@ -122,8 +122,8 @@ interface AutoUpdaterConfig {
|
|||||||
|
|
||||||
async function createMainWindow() {
|
async function createMainWindow() {
|
||||||
const fullscreen = Boolean(await settings.get('fullscreen'));
|
const fullscreen = Boolean(await settings.get('fullscreen'));
|
||||||
const defaultWidth = 800;
|
const defaultWidth = settings.DEFAULT_WIDTH;
|
||||||
const defaultHeight = 480;
|
const defaultHeight = settings.DEFAULT_HEIGHT;
|
||||||
let width = defaultWidth;
|
let width = defaultWidth;
|
||||||
let height = defaultHeight;
|
let height = defaultHeight;
|
||||||
if (fullscreen) {
|
if (fullscreen) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user