mirror of
https://github.com/rubickCenter/rubick
synced 2025-06-20 19:22:43 +08:00
ref: 优化超级面板首次加载过慢的情况
This commit is contained in:
parent
888cff4cda
commit
435ecc6121
@ -203,27 +203,16 @@ class Listener {
|
|||||||
|
|
||||||
superPanel(mainWindow) {
|
superPanel(mainWindow) {
|
||||||
// 长按右击呼起超级面板
|
// 长按右击呼起超级面板
|
||||||
|
superPanel.init(mainWindow);
|
||||||
ipcMain.on('right-down', async () => {
|
ipcMain.on('right-down', async () => {
|
||||||
|
|
||||||
const copyResult = await this.getSelectedContent();
|
const copyResult = await this.getSelectedContent();
|
||||||
let win = superPanel.getWindow();
|
let win = superPanel.getWindow();
|
||||||
|
|
||||||
if (win) {
|
win.webContents.send('trigger-super-panel', {
|
||||||
win.webContents.send('trigger-super-panel', {
|
...copyResult,
|
||||||
...copyResult,
|
optionPlugin: this.optionPlugin.plugins,
|
||||||
optionPlugin: this.optionPlugin.plugins,
|
});
|
||||||
});
|
|
||||||
} else {
|
|
||||||
superPanel.init(mainWindow);
|
|
||||||
win = superPanel.getWindow();
|
|
||||||
|
|
||||||
win.once('ready-to-show', () => {
|
|
||||||
win.webContents.send('trigger-super-panel', {
|
|
||||||
...copyResult,
|
|
||||||
optionPlugin: this.optionPlugin.plugins,
|
|
||||||
});
|
|
||||||
});
|
|
||||||
}
|
|
||||||
const pos = this.getPos(robot.getMousePos());
|
const pos = this.getPos(robot.getMousePos());
|
||||||
win.setPosition(parseInt(pos.x), parseInt(pos.y));
|
win.setPosition(parseInt(pos.x), parseInt(pos.y));
|
||||||
win.show();
|
win.show();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user