Skip to content

Commit d90b91d

Browse files
committed
Let non-darwin platform to use frameless window
1 parent 7fa597a commit d90b91d

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

window.js

+5-6
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
const {BrowserWindow} = require('electron');
22
const os = require('os');
33

4+
const isMac = os.platform() === 'darwin';
5+
46
const winOption = {
57
width: 1100,
68
height: 768,
79
minWidth: 522,
8-
minHeight: 400
10+
minHeight: 400,
11+
frame: isMac
912
}
1013

11-
const isDarwin = os.platform() === 'darwin';
12-
1314
function createWindow (opts={}) {
1415
const win = new BrowserWindow(
15-
(isDarwin
16-
? Object.assign({}, winOption, {titleBarStyle: 'hidden'})
17-
: winOption)
16+
Object.assign({}, winOption, {titleBarStyle: 'hidden'})
1817
);
1918

2019
if (opts.hasOwnProperty('url')) {

0 commit comments

Comments
 (0)