-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathwelcome.window.js
More file actions
47 lines (40 loc) · 1.06 KB
/
welcome.window.js
File metadata and controls
47 lines (40 loc) · 1.06 KB
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
39
40
41
42
43
44
45
46
47
/**
* SPDX-FileCopyrightText: 2022 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
const { BrowserWindow } = require('electron')
const { getBrowserWindowIcon } = require('../shared/icons.utils.js')
const { isMac } = require('../app/system.utils.ts')
const { getScaledWindowSize, showWhenWindowMarkedReady } = require('../app/utils.ts')
/**
* @return {import('electron').BrowserWindow}
*/
function createWelcomeWindow() {
const window = new BrowserWindow({
...getScaledWindowSize({
width: 300,
height: 500,
}, false),
resizable: false,
autoHideMenuBar: true,
center: true,
fullscreenable: false,
titleBarStyle: 'hidden',
show: false,
useContentSize: true,
webPreferences: {
preload: WELCOME_WINDOW_PRELOAD_WEBPACK_ENTRY,
},
icon: getBrowserWindowIcon(),
})
if (isMac) {
// Hide traffic light buttons on Mac
window.setWindowButtonVisibility(false)
}
window.loadURL(WELCOME_WINDOW_WEBPACK_ENTRY)
showWhenWindowMarkedReady(window)
return window
}
module.exports = {
createWelcomeWindow,
}