Files
clash-proxy/src/components/layout/layout-control.tsx

42 lines
951 B
TypeScript
Raw Normal View History

2022-01-16 03:11:07 +08:00
import { Button } from "@mui/material";
import { appWindow } from "@tauri-apps/api/window";
import {
CloseRounded,
2022-01-17 02:15:06 +08:00
CropSquareRounded,
2022-01-16 03:11:07 +08:00
HorizontalRuleRounded,
} from "@mui/icons-material";
2022-01-16 18:30:25 +08:00
const LayoutControl = () => {
2022-01-17 02:15:06 +08:00
const minWidth = 40;
2022-01-16 03:11:07 +08:00
return (
<>
<Button
size="small"
2022-01-17 02:15:06 +08:00
sx={{ minWidth, svg: { transform: "scale(0.9)" } }}
2022-01-16 03:11:07 +08:00
onClick={() => appWindow.minimize()}
>
2022-01-17 02:15:06 +08:00
<HorizontalRuleRounded fontSize="small" />
2022-01-16 03:11:07 +08:00
</Button>
<Button
size="small"
2022-01-17 02:15:06 +08:00
sx={{ minWidth, svg: { transform: "scale(0.9)" } }}
2022-01-16 03:11:07 +08:00
onClick={() => appWindow.toggleMaximize()}
>
2022-01-17 02:15:06 +08:00
<CropSquareRounded fontSize="small" />
2022-01-16 03:11:07 +08:00
</Button>
<Button
size="small"
2022-01-17 02:15:06 +08:00
sx={{ minWidth, svg: { transform: "scale(1.05)" } }}
onClick={() => appWindow.close()}
2022-01-16 03:11:07 +08:00
>
2022-01-17 02:15:06 +08:00
<CloseRounded fontSize="small" />
2022-01-16 03:11:07 +08:00
</Button>
</>
);
};
2022-01-16 18:30:25 +08:00
export default LayoutControl;