mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-20 01:58:04 +08:00
♻️ 代码重构
This commit is contained in:
@@ -1,12 +1,9 @@
|
||||
import { BrowserWindow, ipcMain } from "electron";
|
||||
import { BrowserWindow, ipcMain, dialog } from "electron";
|
||||
import { runner } from "../browsers";
|
||||
|
||||
const runnerInstance = runner();
|
||||
|
||||
const API: any = {
|
||||
setExpendHeight({ height }: { height: number }, win: BrowserWindow): void {
|
||||
win.setSize(800, height || 60);
|
||||
},
|
||||
openPlugin({ plugin }, window) {
|
||||
runnerInstance.removeView(window);
|
||||
runnerInstance.init(plugin, window);
|
||||
@@ -14,6 +11,22 @@ const API: any = {
|
||||
removePlugin(e, window) {
|
||||
runnerInstance.removeView(window);
|
||||
},
|
||||
hideMainWindow(arg, window) {
|
||||
window.hide();
|
||||
},
|
||||
showMainWindow(arg, window) {
|
||||
window.show();
|
||||
},
|
||||
showOpenDialog({ data }, window) {
|
||||
dialog.showOpenDialogSync(window, data);
|
||||
},
|
||||
setExpendHeight({ data: height }, window: BrowserWindow) {
|
||||
const targetHeight = height;
|
||||
window.setSize(window.getSize()[0], targetHeight);
|
||||
},
|
||||
setSubInput() {
|
||||
|
||||
},
|
||||
};
|
||||
|
||||
export default (mainWindow: BrowserWindow) => {
|
||||
|
||||
Reference in New Issue
Block a user