clash-verge-rev/src/components/layout/layout-control.tsx
ctaoist 5164aec37b
feat: light mode wip (#96)
* 关闭窗口释放UI资源

* windows 还有左键点击事件

* 兼容enhance profile

* bug 修复
2022-05-25 16:06:39 +08:00

42 lines
951 B
TypeScript

import { Button } from "@mui/material";
import { appWindow } from "@tauri-apps/api/window";
import {
CloseRounded,
CropSquareRounded,
HorizontalRuleRounded,
} from "@mui/icons-material";
const LayoutControl = () => {
const minWidth = 40;
return (
<>
<Button
size="small"
sx={{ minWidth, svg: { transform: "scale(0.9)" } }}
onClick={() => appWindow.minimize()}
>
<HorizontalRuleRounded fontSize="small" />
</Button>
<Button
size="small"
sx={{ minWidth, svg: { transform: "scale(0.9)" } }}
onClick={() => appWindow.toggleMaximize()}
>
<CropSquareRounded fontSize="small" />
</Button>
<Button
size="small"
sx={{ minWidth, svg: { transform: "scale(1.05)" } }}
onClick={() => appWindow.close()}
>
<CloseRounded fontSize="small" />
</Button>
</>
);
};
export default LayoutControl;