fix: Try to fix touch drag

#456
This commit is contained in:
MystiPanda 2024-03-11 12:36:20 +08:00
parent 9f94cad615
commit e6589bee5b
4 changed files with 14 additions and 16 deletions

View File

@ -60,6 +60,6 @@ body {
-ms-user-select: none;
}
[data-windrag] {
[data-tauri-drag-region] {
app-region: drag;
}

View File

@ -91,12 +91,13 @@
// background-color: var(--background-color-alpha);
.the-bar {
position: absolute;
top: 0px;
right: 0px;
// position: absolute;
// top: 0px;
// right: 0px;
height: 24px;
display: flex;
align-items: center;
// align-items: center;
justify-content: end;
box-sizing: border-box;
z-index: 2;
}

View File

@ -20,10 +20,10 @@ export const BasePage: React.FC<Props> = (props) => {
return (
<BaseErrorBoundary>
<div className="base-page">
<header data-windrag style={{ userSelect: "none" }}>
<header data-tauri-drag-region="true" style={{ userSelect: "none" }}>
<Typography
sx={{ fontSize: "20px", fontWeight: "700 " }}
data-windrag
data-tauri-drag-region="true"
>
{title}
</Typography>

View File

@ -104,9 +104,6 @@ const Layout = () => {
square
elevation={0}
className={`${OS} layout`}
onPointerDown={(e: any) => {
if (e.target?.dataset?.windrag) appWindow.startDragging();
}}
onContextMenu={(e) => {
// only prevent it on Windows
const validList = ["input", "textarea"];
@ -127,10 +124,10 @@ const Layout = () => {
}),
]}
>
<div className="layout__left" data-windrag>
<div className="the-logo" data-windrag>
<div className="layout__left" data-tauri-drag-region="true">
<div className="the-logo" data-tauri-drag-region="true">
{!isDark ? <LogoSvg /> : <LogoSvg_dark />}
{!portableFlag && <UpdateButton className="the-newbtn" />}
{<UpdateButton className="the-newbtn" />}
</div>
<List className="the-menu">
@ -145,14 +142,14 @@ const Layout = () => {
))}
</List>
<div className="the-traffic" data-windrag>
<div className="the-traffic">
<LayoutTraffic />
</div>
</div>
<div className="layout__right" data-windrag>
<div className="layout__right">
{OS === "windows" && (
<div className="the-bar">
<div className="the-bar" data-tauri-drag-region="true">
<LayoutControl />
</div>
)}