2
0
mirror of https://github.com/frappe/books.git synced 2024-09-20 03:29:00 +00:00
books/main/helpers.ts

15 lines
363 B
TypeScript
Raw Normal View History

import electron, { app } from 'electron';
export function getMainWindowSize() {
let height;
if (app.isReady()) {
const screen = electron.screen;
height = screen.getPrimaryDisplay().workAreaSize.height;
height = height > 907 ? 907 : height;
} else {
height = 907;
}
const width = Math.ceil(1.323 * height);
return { height, width };
}