mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-31 08:20:07 +08:00
🐛 fix #212
This commit is contained in:
@@ -1,9 +1,13 @@
|
||||
import { app, BrowserWindow, protocol } from 'electron';
|
||||
import { BrowserWindow, ipcMain, nativeTheme } from 'electron';
|
||||
import path from 'path';
|
||||
export default () => {
|
||||
let win: any;
|
||||
|
||||
const init = (pluginInfo, viewInfo, view) => {
|
||||
ipcMain.on('detach:service', async (event, arg: { type: string }) => {
|
||||
const data = await operation[arg.type]();
|
||||
event.returnValue = data;
|
||||
});
|
||||
createWindow(pluginInfo, viewInfo, view);
|
||||
};
|
||||
|
||||
@@ -20,6 +24,7 @@ export default () => {
|
||||
frame: true,
|
||||
show: false,
|
||||
enableLargerThanScreen: true,
|
||||
backgroundColor: nativeTheme.shouldUseDarkColors ? '#1c1c28' : '#fff',
|
||||
x: viewInfo.x,
|
||||
y: viewInfo.y,
|
||||
webPreferences: {
|
||||
@@ -28,6 +33,7 @@ export default () => {
|
||||
backgroundThrottling: false,
|
||||
contextIsolation: false,
|
||||
webviewTag: true,
|
||||
devTools: true,
|
||||
nodeIntegration: true,
|
||||
},
|
||||
});
|
||||
@@ -70,6 +76,19 @@ export default () => {
|
||||
|
||||
const getWindow = () => win;
|
||||
|
||||
const operation = {
|
||||
minimize: () => {
|
||||
win.focus();
|
||||
win.minimize();
|
||||
},
|
||||
maximize: () => {
|
||||
win.isMaximized() ? win.unmaximize() : win.maximize();
|
||||
},
|
||||
close: () => {
|
||||
win.close();
|
||||
},
|
||||
};
|
||||
|
||||
return {
|
||||
init,
|
||||
getWindow,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import main from "./main";
|
||||
import runner from "./runner";
|
||||
import detach from "./detach";
|
||||
import main from './main';
|
||||
import runner from './runner';
|
||||
import detach from './detach';
|
||||
export { main, runner, detach };
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { app, BrowserWindow, protocol } from 'electron';
|
||||
import { app, BrowserWindow, protocol, nativeTheme } from 'electron';
|
||||
import path from 'path';
|
||||
import { createProtocol } from 'vue-cli-plugin-electron-builder/lib';
|
||||
import versonHandler from '../common/versionHandler';
|
||||
@@ -19,6 +19,7 @@ export default () => {
|
||||
title: '拉比克',
|
||||
show: false,
|
||||
skipTaskbar: true,
|
||||
backgroundColor: nativeTheme.shouldUseDarkColors ? '#1c1c28' : '#fff',
|
||||
webPreferences: {
|
||||
webSecurity: false,
|
||||
enableRemoteModule: true,
|
||||
|
||||
Reference in New Issue
Block a user