Skip to content

Commit

Permalink
index: add electron-window-state to manage window state
Browse files Browse the repository at this point in the history
Semver: minor
  • Loading branch information
evanlucas committed Nov 2, 2017
1 parent f10b3e4 commit 3424052
Show file tree
Hide file tree
Showing 3 changed files with 2,288 additions and 629 deletions.
13 changes: 11 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict'

const electron = require('electron')
const windowState = require('electron-window-state')
const BrowserWindow = electron.BrowserWindow
const app = electron.app
const path = require('path')
Expand All @@ -23,10 +24,16 @@ var mainWindow
function setup() {
setupHome()
shortcuts.unregister('ctrl+r')
const mainWindowState = windowState({
defaultWidth: 1200
, defaultHeight: 800
})

mainWindow = new BrowserWindow({
width: 1200
, height: 730
x: mainWindowState.x
, y: mainWindowState.y
, width: mainWindowState.width
, height: mainWindowState.height
, 'min-height': 400
, 'min-width': 600
, resizable: true
Expand All @@ -35,6 +42,8 @@ function setup() {
, title: name
})

mainWindowState.manage(mainWindow)

const App = require('./lib/app')
App.create({
resourcePath: process.env.EYEARESEE_RESOURCE_PATH
Expand Down

0 comments on commit 3424052

Please sign in to comment.