# Conflicts:
#	feature/src/App.vue
#	feature/src/views/market/index.vue
#	feature/src/views/settings/index.vue
This commit is contained in:
sunyuqiang
2023-08-01 14:10:25 +08:00
42 changed files with 176 additions and 43 deletions

View File

@@ -2,11 +2,11 @@ export default {
version: 11,
perf: {
custom: {
primaryColor: '#106898',
primaryColor: '#ff4ea4',
errorColor: '#ed6d46',
warningColor: '#e5a84b',
successColor: '#c0d695',
infoColor: '#007175',
infoColor: '#aa8eeB',
logo: `file://${__static}/logo.png`,
placeholder: '你好 rubick',
},

View File

@@ -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);
};
@@ -19,6 +23,7 @@ export default () => {
frame: true,
show: false,
enableLargerThanScreen: true,
backgroundColor: nativeTheme.shouldUseDarkColors ? '#1c1c28' : '#fff',
x: viewInfo.x,
y: viewInfo.y,
webPreferences: {
@@ -27,6 +32,7 @@ export default () => {
backgroundThrottling: false,
contextIsolation: false,
webviewTag: true,
devTools: true,
nodeIntegration: true,
},
});
@@ -44,6 +50,11 @@ export default () => {
});
win.once('ready-to-show', () => {
const darkMode = global.OP_CONFIG.get().perf.common.darkMode;
darkMode &&
win.webContents.executeJavaScript(
`document.body.classList.add("dark");window.rubick.theme="dark"`
);
win.setBrowserView(view);
win.webContents.executeJavaScript(
`window.initDetach(${JSON.stringify(pluginInfo)})`
@@ -64,6 +75,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,

View File

@@ -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 };

View File

@@ -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,

View File

@@ -109,6 +109,7 @@ const sort = (options) => {
background: var(--color-body-bg);
color: var(--color-text-content);
border-color: var(--color-border-light);
border-bottom: 1px solid var(--color-border-light);
&.active {
background: var(--color-list-hover);
}