mirror of
https://github.com/rubickCenter/rubick
synced 2025-08-02 15:49:31 +08:00
🔨 优化mac拖拽
This commit is contained in:
parent
2cd70bd386
commit
edbc4d0749
@ -1,4 +1,5 @@
|
|||||||
import { ipcRenderer } from 'electron';
|
import { ipcRenderer } from 'electron';
|
||||||
|
import commonConst from './commonConst';
|
||||||
|
|
||||||
const useDrag = () => {
|
const useDrag = () => {
|
||||||
let animationId: number;
|
let animationId: number;
|
||||||
@ -9,6 +10,7 @@ const useDrag = () => {
|
|||||||
let draggable = true;
|
let draggable = true;
|
||||||
|
|
||||||
const onMouseDown = (e) => {
|
const onMouseDown = (e) => {
|
||||||
|
if (commonConst.macOS()) return;
|
||||||
draggable = true;
|
draggable = true;
|
||||||
mouseX = e.clientX;
|
mouseX = e.clientX;
|
||||||
mouseY = e.clientY;
|
mouseY = e.clientY;
|
||||||
|
@ -1,5 +1,9 @@
|
|||||||
<template>
|
<template>
|
||||||
<div id="components-layout" @mousedown="onMouseDown">
|
<div
|
||||||
|
id="components-layout"
|
||||||
|
:class="commonConst.macOS() && 'drag'"
|
||||||
|
@mousedown="onMouseDown"
|
||||||
|
>
|
||||||
<Search
|
<Search
|
||||||
:currentPlugin="currentPlugin"
|
:currentPlugin="currentPlugin"
|
||||||
@changeCurrent="changeIndex"
|
@changeCurrent="changeIndex"
|
||||||
@ -34,6 +38,7 @@ import Search from './components/search.vue';
|
|||||||
import getWindowHeight from '../common/utils/getWindowHeight';
|
import getWindowHeight from '../common/utils/getWindowHeight';
|
||||||
import createPluginManager from './plugins-manager';
|
import createPluginManager from './plugins-manager';
|
||||||
import useDrag from '../common/utils/dragWindow';
|
import useDrag from '../common/utils/dragWindow';
|
||||||
|
import commonConst from '@/common/utils/commonConst';
|
||||||
|
|
||||||
const { onMouseDown } = useDrag();
|
const { onMouseDown } = useDrag();
|
||||||
|
|
||||||
@ -120,5 +125,8 @@ const clearSearchValue = () => {
|
|||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
width: 0;
|
width: 0;
|
||||||
}
|
}
|
||||||
|
&.drag {
|
||||||
|
-webkit-app-region: drag;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user