mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-20 03:03:40 +08:00
43 lines
809 B
JavaScript
43 lines
809 B
JavaScript
const { BrowserWindow, nativeImage } = require("electron")
|
|
|
|
module.exports = () => {
|
|
let win
|
|
|
|
let init = (x, y) => {
|
|
if (win === null || win === undefined) {
|
|
createWindow()
|
|
}
|
|
}
|
|
|
|
let createWindow = () => {
|
|
win = new BrowserWindow({
|
|
frame: false,
|
|
autoHideMenuBar: true,
|
|
width: 108,
|
|
height: 108,
|
|
transparent: true,
|
|
alwaysOnTop: true,
|
|
resizable: false,
|
|
focusable: true,
|
|
hasShadow: false,
|
|
webPreferences: {
|
|
nodeIntegration: true,
|
|
contextIsolation: false,
|
|
devTools: false,
|
|
},
|
|
})
|
|
|
|
win.loadURL(`file://${__static}/plugins/picker/index.html`)
|
|
win.on("closed", () => {
|
|
win = undefined
|
|
})
|
|
}
|
|
|
|
let getWindow = () => win
|
|
|
|
return {
|
|
init: init,
|
|
getWindow: getWindow,
|
|
}
|
|
}
|