From e6589bee5bb6f14400fd5e5cf5fb664ea35dc4c0 Mon Sep 17 00:00:00 2001 From: MystiPanda Date: Mon, 11 Mar 2024 12:36:20 +0800 Subject: [PATCH] fix: Try to fix touch drag #456 --- src/assets/styles/index.scss | 2 +- src/assets/styles/layout.scss | 9 +++++---- src/components/base/base-page.tsx | 4 ++-- src/pages/_layout.tsx | 15 ++++++--------- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/assets/styles/index.scss b/src/assets/styles/index.scss index e31b5137..36bb58a7 100644 --- a/src/assets/styles/index.scss +++ b/src/assets/styles/index.scss @@ -60,6 +60,6 @@ body { -ms-user-select: none; } -[data-windrag] { +[data-tauri-drag-region] { app-region: drag; } diff --git a/src/assets/styles/layout.scss b/src/assets/styles/layout.scss index aaa09502..fe2ef306 100644 --- a/src/assets/styles/layout.scss +++ b/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; } diff --git a/src/components/base/base-page.tsx b/src/components/base/base-page.tsx index b8b072c4..07f0c812 100644 --- a/src/components/base/base-page.tsx +++ b/src/components/base/base-page.tsx @@ -20,10 +20,10 @@ export const BasePage: React.FC = (props) => { return (
-
+
{title} diff --git a/src/pages/_layout.tsx b/src/pages/_layout.tsx index ba177e76..ce58f90b 100644 --- a/src/pages/_layout.tsx +++ b/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 = () => { }), ]} > -
-
+
+
{!isDark ? : } - {!portableFlag && } + {}
@@ -145,14 +142,14 @@ const Layout = () => { ))} -
+
-
+
{OS === "windows" && ( -
+
)}