From fd6c7a8e8386bbe7708a605e173d2b3c25c8b8f3 Mon Sep 17 00:00:00 2001 From: astrid Date: Thu, 22 Aug 2024 00:34:08 +0200 Subject: [PATCH] minimize button --- .../components/tauri/templates/Navigation.tsx | 48 +++++++++++++------ 1 file changed, 33 insertions(+), 15 deletions(-) diff --git a/packages/mtc-artillery/src/components/tauri/templates/Navigation.tsx b/packages/mtc-artillery/src/components/tauri/templates/Navigation.tsx index fc9defb1..68183510 100644 --- a/packages/mtc-artillery/src/components/tauri/templates/Navigation.tsx +++ b/packages/mtc-artillery/src/components/tauri/templates/Navigation.tsx @@ -1,4 +1,5 @@ import Close from '@mui/icons-material/Close'; +import Minimize from '@mui/icons-material/Minimize'; import Box from '@mui/joy/Box'; import IconButton from '@mui/joy/IconButton'; import Typography from '@mui/joy/Typography'; @@ -36,25 +37,42 @@ export default function Navigation() { - { - try { - const { appWindow } = await import('@tauri-apps/api/window'); - - appWindow.close(); - } catch (error) { - console.error(error); - } + borderRadius: 4, + '& > button': { borderRadius: 0 }, }} > - - + { + try { + const { appWindow } = await import('@tauri-apps/api/window'); + + appWindow.minimize(); + } catch (error) { + console.error(error); + } + }} + > + + + { + try { + const { appWindow } = await import('@tauri-apps/api/window'); + + appWindow.close(); + } catch (error) { + console.error(error); + } + }} + > + + + );