支持网页快开插件

This commit is contained in:
muwoo 2023-11-02 16:00:50 +08:00
parent 9663232864
commit 562a13fdff
4 changed files with 16 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "rubick",
"version": "4.1.2",
"version": "4.1.3",
"author": "muwoo <2424880409@qq.com>",
"private": true,
"scripts": {

View File

@ -1,5 +1,6 @@
export const WINDOW_WIDTH = 688;
export const WINDOW_HEIGHT = 60;
export const WINDOW_PLUGIN_HEIGHT = 600;
export const GUIDE_WIDTH = 800;
export const GUIDE_HEIGHT = 600;

View File

@ -3,6 +3,11 @@ import path from 'path';
import commonConst from '../../common/utils/commonConst';
import { PLUGIN_INSTALL_DIR as baseDir } from '@/common/constans/main';
import localConfig from '@/main/common/initLocalConfig';
import {
WINDOW_HEIGHT,
WINDOW_PLUGIN_HEIGHT,
WINDOW_WIDTH,
} from '@/common/constans/common';
const getRelativePath = (indexPath) => {
return commonConst.windows()
@ -57,8 +62,13 @@ export default () => {
const viewReadyFn = async (window, { pluginSetting, ext }) => {
if (!view) return;
const height = pluginSetting && pluginSetting.height;
window.setSize(800, height || 600);
view.setBounds({ x: 0, y: 60, width: 800, height: height || 540 });
window.setSize(WINDOW_WIDTH, height || WINDOW_PLUGIN_HEIGHT);
view.setBounds({
x: 0,
y: WINDOW_HEIGHT,
width: WINDOW_WIDTH,
height: height || WINDOW_PLUGIN_HEIGHT - WINDOW_HEIGHT,
});
view.setAutoResize({ width: true, height: true });
executeHooks('PluginEnter', ext);
executeHooks('PluginReady', ext);

View File

@ -78,13 +78,13 @@ getPluginInfo({
watch([options, pluginHistory, currentPlugin], () => {
currentSelect.value = 0;
// if (currentPlugin.value.name) return;
if (currentPlugin.value.name) return;
nextTick(() => {
ipcRenderer.sendSync('msg-trigger', {
type: 'setExpendHeight',
data: getWindowHeight(
options.value,
(pluginLoading.value || currentPlugin.value.name) ? [] : pluginHistory.value
(pluginLoading.value) ? [] : pluginHistory.value
),
});
});