-
Notifications
You must be signed in to change notification settings - Fork 9
/
index.js
38 lines (33 loc) · 903 Bytes
/
index.js
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
29
30
31
32
33
34
35
36
37
38
const path = require('path')
const { app, BrowserWindow, globalShortcut } = require('electron')
const backgroundColor = '#ffffff'
const windowOptions = {
width: 800,
height: 500,
backgroundColor,
center: true,
frame: true,
minHeight: 500,
minWidth: 800,
title: 'Peerdrop'
}
//
// On darwin we can hide the frame, but on linux, all pointer events are
// obscured by `-weblkit-app-region: drag` so we need the os's titlebar.
//
if (process.platform === 'darwin') {
windowOptions.frame = false
}
app.on('ready', () => {
const mainWindow = new BrowserWindow(windowOptions)
mainWindow.loadURL('file://' + path.join(__dirname, 'index.html'))
//
// On Windows and Linux we can hide the menu bar.
//
if (process.platform !== 'darwin') {
mainWindow.setMenu(null)
globalShortcut.register('CommandOrControl+Shift+I', () => {
mainWindow.openDevTools()
})
}
})