From d6df22f98aa424720ad0494fd7faa45684a48e94 Mon Sep 17 00:00:00 2001 From: muwoo <2424880409@qq.com> Date: Wed, 21 Jul 2021 10:23:37 +0800 Subject: [PATCH 1/7] =?UTF-8?q?ref:=20=E6=94=AF=E6=8C=81=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E5=B8=82=E5=9C=BA=E5=B1=95=E7=A4=BA=E6=8F=92=E4=BB=B6=E6=8F=8F?= =?UTF-8?q?=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/tray.js | 50 +++++------ src/renderer/App.vue | 6 ++ src/renderer/pages/search/subpages/market.vue | 86 ++++++++++++++++++- 3 files changed, 115 insertions(+), 27 deletions(-) diff --git a/src/main/tray.js b/src/main/tray.js index c2a4e1b..04f2517 100644 --- a/src/main/tray.js +++ b/src/main/tray.js @@ -7,7 +7,20 @@ function createTray(window) { const appIcon = new Tray(path.join(__static, './rocket.png')); const contextMenu = Menu.buildFromTemplate([ { - id: 3, + label: "帮助文档", click: () => { + process.nextTick((() => { + shell.openExternal('https://github.com/clouDr-f2e/rubick'); + })) + } + }, { + label: "意见反馈", click: () => { + process.nextTick((() => { + shell.openExternal('https://github.com/clouDr-f2e/rubick/issues') + })) + } + }, + {type: "separator"}, + { label: '显示窗口', accelerator: "Alt+R", click() { @@ -15,23 +28,25 @@ function createTray(window) { } }, { - id: 4, - label: '文档', + role: 'quit', + label: '退出' + }, + { + label: '重启', click() { - shell.openExternal('https://muwoo.github.io/rubick-doc/'); + app.relaunch(); + app.quit(); } }, - + {type: "separator"}, { - id: 5, - label: '显示窗口', + label: '偏好设置', click() { window.show(); - } + window.webContents.send('tray-setting'); + }, }, - { - id: 6, label: '关于', click() { dialog.showMessageBox({ @@ -39,21 +54,8 @@ function createTray(window) { message: '极简、插件化的现代桌面软件', detail: `Version: ${pkg.version}\nAuthor: muwoo` }); - } + }, }, - { - id: 7, - role: 'quit', - label: '退出' - }, - { - id: 7, - label: '重启', - click() { - app.relaunch(); - app.exit(); - } - } ]); appIcon.on('click', () => { appIcon.popUpContextMenu(contextMenu); diff --git a/src/renderer/App.vue b/src/renderer/App.vue index 7c5ff14..e1bc3ac 100644 --- a/src/renderer/App.vue +++ b/src/renderer/App.vue @@ -108,6 +108,7 @@ export default { ipcRenderer.on('new-window', this.newWindow); // 超级面板打开插件 ipcRenderer.on('superPanel-openPlugin', (e, args) => { + this.closeTag(); ipcRenderer.send('msg-trigger', { type: 'showMainWindow', }); @@ -145,6 +146,11 @@ export default { }); config && this.openPlugin(config); }); + // 打开偏好设置 + ipcRenderer.on('tray-setting', () => { + this.showMainUI(); + this.changePath({key: 'settings'}); + }); const searchNd = document.getElementById('search'); searchNd && searchNd.addEventListener('keydown', this.checkNeedInit) }, diff --git a/src/renderer/pages/search/subpages/market.vue b/src/renderer/pages/search/subpages/market.vue index efd9ca0..b43e9b7 100644 --- a/src/renderer/pages/search/subpages/market.vue +++ b/src/renderer/pages/search/subpages/market.vue @@ -26,7 +26,7 @@ {{ item.pluginName }} @@ -37,12 +37,43 @@ + + + + + {{currentSelect.pluginName}} + + + 开发者:{{currentSelect.author}} + + 获取 + + + {{currentSelect.description}} + + + + +