mirror of
https://github.com/frappe/books.git
synced 2024-11-14 09:24:04 +00:00
15 lines
363 B
TypeScript
15 lines
363 B
TypeScript
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 };
|
|
}
|