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

feat: new fullscreen

parent b9ce2b2c
No related branches found
No related tags found
1 merge request!9Version 0.4.0 🍾
Pipeline #1361 passed
...@@ -68,10 +68,13 @@ export const App: FC<AppProps> = ({ emulator, backgrounds = ["264653"] }) => { ...@@ -68,10 +68,13 @@ export const App: FC<AppProps> = ({ emulator, backgrounds = ["264653"] }) => {
const onResetClick = () => { const onResetClick = () => {
emulator.reset(); emulator.reset();
}; };
const onFullscreenClick = () => {
setFullscreen((!fullscreen);
};
const onThemeClick = () => { const onThemeClick = () => {
setBackgroundIndex((backgroundIndex + 1) % backgrounds.length); setBackgroundIndex((backgroundIndex + 1) % backgrounds.length);
}; };
const onDrawHAndler = (handler: DrawHandler) => { const onDrawHandler = (handler: DrawHandler) => {
setInterval(() => { setInterval(() => {
handler(emulator.getImageBuffer(), PixelFormat.RGB); handler(emulator.getImageBuffer(), PixelFormat.RGB);
}, 1000); }, 1000);
...@@ -90,7 +93,7 @@ export const App: FC<AppProps> = ({ emulator, backgrounds = ["264653"] }) => { ...@@ -90,7 +93,7 @@ export const App: FC<AppProps> = ({ emulator, backgrounds = ["264653"] }) => {
<PanelSplit <PanelSplit
left={ left={
<div> <div>
<Display fullscreen={fullscreen} onDrawHandler={onDrawHAndler} /> <Display fullscreen={fullscreen} onDrawHandler={onDrawHandler} />
</div> </div>
} }
> >
...@@ -148,6 +151,12 @@ export const App: FC<AppProps> = ({ emulator, backgrounds = ["264653"] }) => { ...@@ -148,6 +151,12 @@ export const App: FC<AppProps> = ({ emulator, backgrounds = ["264653"] }) => {
imageAlt="reset" imageAlt="reset"
onClick={onResetClick} onClick={onResetClick}
/> />
<Button
text={"Fullscreen"}
image={require("../res/maximise.svg")}
imageAlt="maximise"
onClick={onFullscreenClick}
/>
<Button <Button
text={"Theme"} text={"Theme"}
image={require("../res/marker.svg")} image={require("../res/marker.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