mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-23 19:26:33 +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() {
|
function createMainWindow() {
|
||||||
const fullscreen = Boolean(settings.get('fullscreen'));
|
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({
|
const mainWindow = new electron.BrowserWindow({
|
||||||
width: parseInt(settings.get('width'), 10) || 800,
|
width,
|
||||||
height: parseInt(settings.get('height'), 10) || 480,
|
height,
|
||||||
frame: !fullscreen,
|
frame: !fullscreen,
|
||||||
useContentSize: false,
|
useContentSize: false,
|
||||||
show: false,
|
show: false,
|
||||||
@ -77,10 +84,12 @@ function createMainWindow() {
|
|||||||
backgroundThrottling: false,
|
backgroundThrottling: false,
|
||||||
nodeIntegration: true,
|
nodeIntegration: true,
|
||||||
webviewTag: true,
|
webviewTag: true,
|
||||||
|
zoomFactor: width / defaultWidth,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
buildWindowMenu(mainWindow);
|
buildWindowMenu(mainWindow);
|
||||||
|
mainWindow.setFullScreen(true);
|
||||||
|
|
||||||
// Prevent flash of white when starting the application
|
// Prevent flash of white when starting the application
|
||||||
mainWindow.on('ready-to-show', () => {
|
mainWindow.on('ready-to-show', () => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user