提交 cd5899bd 编写于 作者: 璃白.'s avatar 璃白. 🌻

fix:适配windows

上级 bc8fb197
...@@ -29,7 +29,7 @@ module.exports = () => { ...@@ -29,7 +29,7 @@ module.exports = () => {
backgroundThrottling: false, backgroundThrottling: false,
contextIsolation: false, contextIsolation: false,
webviewTag: true, webviewTag: true,
devTools: true, devTools: false,
nodeIntegration: true, // 在网页中集成Node nodeIntegration: true, // 在网页中集成Node
preload: `${path.resolve(__dirname, "./preload.js")}` preload: `${path.resolve(__dirname, "./preload.js")}`
} }
......
...@@ -417,6 +417,7 @@ class Listener { ...@@ -417,6 +417,7 @@ class Listener {
windowMoveInit(win) { windowMoveInit(win) {
let hasInit = false; let hasInit = false;
ipcMain.on("window-move", () => { ipcMain.on("window-move", () => {
let bounds = win.getBounds();
if (!hasInit) { if (!hasInit) {
hasInit = true; hasInit = true;
ioHook.start(false); ioHook.start(false);
...@@ -432,7 +433,9 @@ class Listener { ...@@ -432,7 +433,9 @@ class Listener {
winStartPosition.x + cursorPosition.x - mouseStartPosition.x; winStartPosition.x + cursorPosition.x - mouseStartPosition.x;
const dy = const dy =
winStartPosition.y + cursorPosition.y - mouseStartPosition.y; winStartPosition.y + cursorPosition.y - mouseStartPosition.y;
win.setPosition(parseInt(dx), parseInt(dy)); bounds.x = parseInt(dx);
bounds.y = parseInt(dy);
win.setBounds(bounds);
}); });
ioHook.on("mouseup", e => { ioHook.on("mouseup", e => {
......
<template> <template>
<div id="app" @mousedown="drag"> <div id="app" @mousedown="drag">
<a-layout id="components-layout"> <a-layout id="components-layout" :class="[{ mac: isMac }]">
<div v-if="!searchType" class="rubick-select"> <div v-if="!searchType" class="rubick-select">
<div v-if="selected" class="tag-container"> <div v-if="selected" class="tag-container">
<template v-if="isWebview"> <template v-if="isWebview">
...@@ -488,6 +488,9 @@ export default { ...@@ -488,6 +488,9 @@ export default {
"userInfo", "userInfo",
"pluginLoading" "pluginLoading"
]), ]),
isMac() {
return commonConst.macOS()
},
isWebview() { isWebview() {
return this.pluginInfo.subType === "webview"; return this.pluginInfo.subType === "webview";
}, },
...@@ -546,9 +549,11 @@ body { ...@@ -546,9 +549,11 @@ body {
#components-layout { #components-layout {
overflow: auto; overflow: auto;
-webkit-app-region: drag;
// margin-top: 14px; // margin-top: 14px;
background: #fff; background: #fff;
&.mac {
-webkit-app-region: drag;
}
::-webkit-scrollbar { ::-webkit-scrollbar {
width: 0; width: 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册