Эх сурвалжийг харах

fix: Try to fix touch drag

#456
MystiPanda 1 жил өмнө
parent
commit
e6589bee5b

+ 1 - 1
src/assets/styles/index.scss

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

+ 5 - 4
src/assets/styles/layout.scss

@@ -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;
     }

+ 2 - 2
src/components/base/base-page.tsx

@@ -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>

+ 6 - 9
src/pages/_layout.tsx

@@ -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>
             )}