fix(striker-ui): add button for fullscreen in VNC display controls

main
Tsu-ba-me 9 months ago
parent 5d086f5e79
commit 7d6bc9aaaf
  1. 18
      striker-ui/components/Display/FullSize.tsx

@ -1,6 +1,7 @@
import { import {
Close as CloseIcon, Close as CloseIcon,
Dashboard as DashboardIcon, Dashboard as DashboardIcon,
Fullscreen as FullscreenIcon,
Keyboard as KeyboardIcon, Keyboard as KeyboardIcon,
} from '@mui/icons-material'; } from '@mui/icons-material';
import { Box, Menu, styled, Typography } from '@mui/material'; import { Box, Menu, styled, Typography } from '@mui/material';
@ -153,6 +154,21 @@ const FullSize: FC<FullSizeProps> = ({
[vncConnecting, vncError], [vncConnecting, vncError],
); );
const fullscreenElement = useMemo(
() => (
<Box>
<IconButton
onClick={() => {
rfbScreen.current?.requestFullscreen();
}}
>
<FullscreenIcon />
</IconButton>
</Box>
),
[],
);
const keyboardMenuElement = useMemo( const keyboardMenuElement = useMemo(
() => ( () => (
<Box> <Box>
@ -215,6 +231,7 @@ const FullSize: FC<FullSizeProps> = ({
() => () =>
showScreen && ( showScreen && (
<> <>
{fullscreenElement}
{keyboardMenuElement} {keyboardMenuElement}
<ServerMenu <ServerMenu
serverName={serverName} serverName={serverName}
@ -226,6 +243,7 @@ const FullSize: FC<FullSizeProps> = ({
</> </>
), ),
[ [
fullscreenElement,
keyboardMenuElement, keyboardMenuElement,
returnHomeElement, returnHomeElement,
serverName, serverName,

Loading…
Cancel
Save