mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-22 18:56:31 +00:00
Use zoomFactor to scale contents in fullscreen mode
Change-type: patch Changelog-entry: Use zoomFactor to scale contents in fullscreen mode
This commit is contained in:
parent
8b2f06442a
commit
4ee83d9da4
@ -58,9 +58,16 @@ async function checkForUpdates(interval: number) {
|
||||
|
||||
function createMainWindow() {
|
||||
const fullscreen = Boolean(settings.get('fullscreen'));
|
||||
const defaultWidth = 800;
|
||||
const defaultHeight = 480;
|
||||
let width = defaultWidth;
|
||||
let height = defaultHeight;
|
||||
if (fullscreen) {
|
||||
({ width, height } = electron.screen.getPrimaryDisplay().bounds);
|
||||
}
|
||||
const mainWindow = new electron.BrowserWindow({
|
||||
width: parseInt(settings.get('width'), 10) || 800,
|
||||
height: parseInt(settings.get('height'), 10) || 480,
|
||||
width,
|
||||
height,
|
||||
frame: !fullscreen,
|
||||
useContentSize: false,
|
||||
show: false,
|
||||
@ -77,10 +84,12 @@ function createMainWindow() {
|
||||
backgroundThrottling: false,
|
||||
nodeIntegration: true,
|
||||
webviewTag: true,
|
||||
zoomFactor: width / defaultWidth,
|
||||
},
|
||||
});
|
||||
|
||||
buildWindowMenu(mainWindow);
|
||||
mainWindow.setFullScreen(true);
|
||||
|
||||
// Prevent flash of white when starting the application
|
||||
mainWindow.on('ready-to-show', () => {
|
||||
|
Loading…
x
Reference in New Issue
Block a user