From b0a82bc7ad7b88e3d37552230998b8234426bb90 Mon Sep 17 00:00:00 2001 From: wonfen Date: Wed, 14 May 2025 22:15:02 +0800 Subject: [PATCH] feat: remove custom window button --- src/assets/styles/layout.scss | 8 +- src/components/layout/layout-control.tsx | 104 ----------------------- src/pages/_layout.tsx | 7 -- 3 files changed, 4 insertions(+), 115 deletions(-) delete mode 100644 src/components/layout/layout-control.tsx diff --git a/src/assets/styles/layout.scss b/src/assets/styles/layout.scss index 1b89702cb..59426ee3a 100644 --- a/src/assets/styles/layout.scss +++ b/src/assets/styles/layout.scss @@ -129,14 +129,14 @@ flex: 1 0 58px; margin-top: 10px; margin-left: 10px; - padding-top: 30px; + padding-top: 5px; padding-left: 10px; padding-right: 20px; padding-bottom: 16px; } .layout__right .the-content { - top: 24px; + top: 5px; } } } @@ -144,11 +144,11 @@ .macos { &.layout { .layout__left { - padding-top: 24px; + padding-top: 5px; } .layout__right .the-content { - top: 24px; + top: 5px; } .layout__left .the-newbtn { diff --git a/src/components/layout/layout-control.tsx b/src/components/layout/layout-control.tsx deleted file mode 100644 index eda6a8c3b..000000000 --- a/src/components/layout/layout-control.tsx +++ /dev/null @@ -1,104 +0,0 @@ -import { Button, ButtonGroup } from "@mui/material"; -import { getCurrentWebviewWindow } from "@tauri-apps/api/webviewWindow"; -import { - CloseRounded, - CropSquareRounded, - FilterNoneRounded, - HorizontalRuleRounded, - PushPinOutlined, - PushPinRounded, -} from "@mui/icons-material"; -import { useEffect, useState } from "react"; -const appWindow = getCurrentWebviewWindow(); - -export const LayoutControl = () => { - const minWidth = 40; - - const [isMaximized, setIsMaximized] = useState(false); - const [isPined, setIsPined] = useState(false); - - useEffect(() => { - const unlistenResized = appWindow.onResized(() => { - appWindow.isMaximized().then((maximized) => { - setIsMaximized(() => maximized); - }); - }); - - appWindow.isMaximized().then((maximized) => { - setIsMaximized(() => maximized); - }); - - return () => { - unlistenResized.then((fn) => fn()); - }; - }, []); - - return ( - - - - - - - - - - ); -}; diff --git a/src/pages/_layout.tsx b/src/pages/_layout.tsx index 337241c95..4b0f68391 100644 --- a/src/pages/_layout.tsx +++ b/src/pages/_layout.tsx @@ -15,7 +15,6 @@ import iconLight from "@/assets/image/icon_light.svg?react"; import iconDark from "@/assets/image/icon_dark.svg?react"; import { useThemeMode, useEnableLog } from "@/services/states"; import { LayoutItem } from "@/components/layout/layout-item"; -import { LayoutControl } from "@/components/layout/layout-control"; import { LayoutTraffic } from "@/components/layout/layout-traffic"; import { UpdateButton } from "@/components/layout/update-button"; import { useCustomTheme } from "@/components/layout/use-custom-theme"; @@ -382,12 +381,6 @@ const Layout = () => {
-
- {OS !== "macos" && }