Skip to content
Snippets Groups Projects
Verified Commit b9ce2b2c authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

feat: new fullscreen mode

parent 549c8afd
No related branches found
No related tags found
1 merge request!9Version 0.4.0 🍾
Pipeline #1360 passed
...@@ -22,6 +22,7 @@ type DisplayOptions = { ...@@ -22,6 +22,7 @@ type DisplayOptions = {
type DisplayProps = { type DisplayProps = {
options?: DisplayOptions; options?: DisplayOptions;
size?: string; size?: string;
fullscreen?: boolean,
style?: string[]; style?: string[];
onDrawHandler?: (caller: DrawHandler) => void; onDrawHandler?: (caller: DrawHandler) => void;
}; };
...@@ -37,6 +38,7 @@ type CanvasContents = { ...@@ -37,6 +38,7 @@ type CanvasContents = {
export const Display: FC<DisplayProps> = ({ export const Display: FC<DisplayProps> = ({
options = { width: 320, height: 288, logicWidth: 160, logicHeight: 144 }, options = { width: 320, height: 288, logicWidth: 160, logicHeight: 144 },
size = "small", size = "small",
fullscreen = false,
style = [], style = [],
onDrawHandler onDrawHandler
}) => { }) => {
...@@ -49,7 +51,7 @@ export const Display: FC<DisplayProps> = ({ ...@@ -49,7 +51,7 @@ export const Display: FC<DisplayProps> = ({
} }
let canvasContents: CanvasContents | null = null; let canvasContents: CanvasContents | null = null;
const classes = () => ["display", size, ...style].join(" "); const classes = () => ["display", fullscreen ? "fullscreen" : null, size, ...style].join(" ");
const canvasRef = useRef<HTMLCanvasElement>(null); const canvasRef = useRef<HTMLCanvasElement>(null);
...@@ -72,7 +74,7 @@ export const Display: FC<DisplayProps> = ({ ...@@ -72,7 +74,7 @@ export const Display: FC<DisplayProps> = ({
return ( return (
<div id="display" className={classes()}> <div id="display" className={classes()}>
<span id="display-close" className="magnify-button canvas-close"> <span id="display-close" className="magnify-button display-close">
<img <img
className="large" className="large"
src={require("./minimise.svg")} src={require("./minimise.svg")}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment