-
Notifications
You must be signed in to change notification settings - Fork 62
Expand file tree
/
Copy pathupgrade.window.js
More file actions
48 lines (40 loc) · 1.11 KB
/
upgrade.window.js
File metadata and controls
48 lines (40 loc) · 1.11 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
48
/**
* SPDX-FileCopyrightText: 2023 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
const { BASE_TITLE } = require('../constants.js')
const { BrowserWindow } = require('electron')
const { applyExternalLinkHandler } = require('../app/externalLinkHandlers.js')
const { getBrowserWindowIcon } = require('../shared/icons.utils.js')
const { getScaledWindowSize, showWhenWindowMarkedReady } = require('../app/utils.ts')
/**
*
* @return {import('electron').BrowserWindow}
*/
function createUpgradeWindow() {
const TITLE = `Upgrade required - ${BASE_TITLE}`
const window = new BrowserWindow({
title: TITLE,
...getScaledWindowSize({
width: 350,
height: 300,
}),
show: false,
maximizable: false,
resizable: false,
fullscreenable: false,
autoHideMenuBar: true,
webPreferences: {
preload: UPGRADE_WINDOW_PRELOAD_WEBPACK_ENTRY,
},
icon: getBrowserWindowIcon(),
})
window.removeMenu()
window.loadURL(UPGRADE_WINDOW_WEBPACK_ENTRY)
applyExternalLinkHandler(window)
showWhenWindowMarkedReady(window)
return window
}
module.exports = {
createUpgradeWindow,
}