mirror of
https://github.com/rubickCenter/rubick
synced 2025-12-18 08:44:16 +08:00
🔨 优化拖拽方案
This commit is contained in:
@@ -6,6 +6,7 @@ import {
|
||||
Notification,
|
||||
nativeImage,
|
||||
clipboard,
|
||||
screen,
|
||||
shell,
|
||||
} from 'electron';
|
||||
import { runner, detach } from '../browsers';
|
||||
@@ -55,6 +56,13 @@ class API {
|
||||
}
|
||||
};
|
||||
|
||||
public windowMoving({ data: { mouseX, mouseY, width, height } }, window, e) {
|
||||
const { x, y } = screen.getCursorScreenPoint();
|
||||
const originWindow = this.getCurrentWindow(window, e);
|
||||
if (!originWindow) return;
|
||||
originWindow.setBounds({ x: x - mouseX, y: y - mouseY });
|
||||
}
|
||||
|
||||
public loadPlugin({ data: plugin }, window) {
|
||||
window.webContents.executeJavaScript(
|
||||
`window.loadPlugin(${JSON.stringify(plugin)})`
|
||||
|
||||
Reference in New Issue
Block a user