Skip to content
This repository has been archived by the owner on Oct 23, 2023. It is now read-only.

Commit

Permalink
feat(window): minimum app window size
Browse files Browse the repository at this point in the history
Set minimum app widnow size. Also try to get primary screen size and start app in whole screen mode.

#107
  • Loading branch information
mpfeil authored and lkuechler committed Feb 23, 2018
1 parent 5f6e133 commit 239d788
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/electron/electron.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { checkForUpdates } from './auto-updater';
import { app, BrowserWindow, ipcMain } from 'electron';
import { app, BrowserWindow, ipcMain, screen } from 'electron';
import * as PathUtils from 'path';
import * as url from 'url';

Expand All @@ -8,10 +8,14 @@ import * as url from 'url';
let win: BrowserWindow | undefined;

function createWindow(): void {
const { width = 1280, height = 800 } = screen.getPrimaryDisplay().workAreaSize;

// Create the browser window.
win = new BrowserWindow({
width: 1280,
height: 800,
width,
height,
minWidth: 780,
minHeight: 380,
titleBarStyle: 'hiddenInset',
title: 'Alva'
});
Expand Down

0 comments on commit 239d788

Please sign in to comment.