-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindow.js
More file actions
28 lines (24 loc) · 818 Bytes
/
window.js
File metadata and controls
28 lines (24 loc) · 818 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
'use strict'
const join = require('path').join
const BrowserWindow = require('electron').BrowserWindow
const config = require('./config')
module.exports = function createMainWindow(handleResize, handleClosed) {
const lastWindowState = config.get('lastWindowState')
const window = new BrowserWindow({
minWidth: 615,
x: lastWindowState.x,
y: lastWindowState.y,
width: lastWindowState.width,
height: lastWindowState.height,
icon: join(__dirname, 'build/icon.png'),
title: 'HackMD Desktop',
titleBarStyle: 'hiddeninset',
webPreferences: {
preload: `${__dirname}/browser.js`
}
})
window.loadURL('https://hackmd.io')
window.on('resize', handleResize)
window.on('closed', handleClosed)
return window
}