layout-control.tsx 950 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import { Button } from "@mui/material";
  2. import { appWindow } from "@tauri-apps/api/window";
  3. import {
  4. CloseRounded,
  5. CropSquareRounded,
  6. HorizontalRuleRounded,
  7. } from "@mui/icons-material";
  8. const LayoutControl = () => {
  9. const minWidth = 40;
  10. return (
  11. <>
  12. <Button
  13. size="small"
  14. sx={{ minWidth, svg: { transform: "scale(0.9)" } }}
  15. onClick={() => appWindow.minimize()}
  16. >
  17. <HorizontalRuleRounded fontSize="small" />
  18. </Button>
  19. <Button
  20. size="small"
  21. sx={{ minWidth, svg: { transform: "scale(0.9)" } }}
  22. onClick={() => appWindow.toggleMaximize()}
  23. >
  24. <CropSquareRounded fontSize="small" />
  25. </Button>
  26. <Button
  27. size="small"
  28. sx={{ minWidth, svg: { transform: "scale(1.05)" } }}
  29. onClick={() => appWindow.hide()}
  30. >
  31. <CloseRounded fontSize="small" />
  32. </Button>
  33. </>
  34. );
  35. };
  36. export default LayoutControl;