diff --git a/package.json b/package.json index 2599eb4..b72e72e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "rubick2", - "version": "0.0.1", + "version": "0.0.2", "author": "muwoo <2424880409@qq.com>", "description": "An electron-vue project", "license": null, diff --git a/src/main/browsers/superPanel.js b/src/main/browsers/superPanel.js index 6113bcd..967c6bd 100644 --- a/src/main/browsers/superPanel.js +++ b/src/main/browsers/superPanel.js @@ -35,7 +35,6 @@ module.exports = () => { }, }); win.loadURL(`file://${__static}/plugins/superPanel/index.html`); - win.once('ready-to-show', () => win.show()); win.on("closed", () => { win = undefined; }); diff --git a/src/main/common/common.js b/src/main/common/common.js index c1e246f..fd65897 100644 --- a/src/main/common/common.js +++ b/src/main/common/common.js @@ -5,6 +5,7 @@ import { clipboard, Notification, app, + screen, } from 'electron'; import Api from './api'; import robot from 'robotjs'; @@ -28,6 +29,14 @@ function registerShortCut(mainWindow) { globalShortcut.unregisterAll(); // 注册偏好快捷键 globalShortcut.register(config.perf.shortCut.showAndHidden, () => { + const {x, y} = screen.getCursorScreenPoint(); + const currentDisplay = screen.getDisplayNearestPoint({ x, y }); + const wx = parseInt(currentDisplay.workArea.x + currentDisplay.workArea.width / 2 - 400); + const wy = parseInt(currentDisplay.workArea.y + currentDisplay.workArea.height / 2 - 200); + mainWindow.setVisibleOnAllWorkspaces(true); + mainWindow.focus(); + mainWindow.setVisibleOnAllWorkspaces(false); + mainWindow.setPosition(wx, wy); mainWindow.show(); }); diff --git a/src/renderer/pages/search/subpages/market.vue b/src/renderer/pages/search/subpages/market.vue index 671d6fc..efd9ca0 100644 --- a/src/renderer/pages/search/subpages/market.vue +++ b/src/renderer/pages/search/subpages/market.vue @@ -26,6 +26,7 @@
{{ item.pluginName }}
@@ -48,7 +49,9 @@ export default { return { pluginList: [], loading: {}, - bannerList: [] + bannerList: [], + show: false, + currentSelect: {} } }, async created() { @@ -75,6 +78,10 @@ export default { showButton(item) { return !this.devPlugins.filter(plugin => (plugin.name === item.name && plugin.type === 'prod')).length; }, + showPannel(item) { + this.show = true; + this.currentSelect = item; + }, ...mapActions('main', ['downloadPlugin']) }, computed: {