Merge pull request #8 from iflan/maximize-in-window

Allow Shift-F2 to maximize the Apple screen in the window
This commit is contained in:
Will Scullin 2019-02-28 21:24:09 -08:00 committed by GitHub
commit 9e706b5991
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 49 additions and 1 deletions

View File

@ -81,6 +81,45 @@ label {
border-radius: 10px;
}
.zoomwindow {
width: 100vw;
height: 68.5714vw; /* 384px / 560px * 100% */
max-height: 100vh;
max-width: 145.83vh; /* 560px / 384px * 100% */
padding: 0;
border: 0;
position: fixed;
top:0;
bottom: 0;
left: 0;
right: 0;
justify-content: center;
align-items: center;
margin: auto !important;
}
.maxhw {
width: 100%;
height: 100%;
}
.flexbox-centering {
height: 100%;
display: flex;
justify-content: center;
align-items: center;
background: green;
}
.hidden {
display: none !important;
}
.fillparent {
width: 100%;
height: 100%;
}
#power {
padding: 2px;
border: 1px inset #888;

View File

@ -786,7 +786,16 @@ function _keydown(evt) {
evt.preventDefault(); // prevent launching help
} else if (evt.keyCode === 113) { // F2 - Full Screen
var elem = document.getElementById('screen');
if (document.webkitCancelFullScreen) {
if (evt.shiftKey) { // Full window, but not full screen
$('#display').toggleClass('zoomwindow');
$('#display > div')
.toggleClass('overscan')
.toggleClass('flexbox-centering');
$('#screen').toggleClass('maxhw');
$('#header').toggleClass('hidden');
$('.inset').toggleClass('hidden');
$('#reset').toggleClass('hidden');
} else if (document.webkitCancelFullScreen) {
if (document.webkitIsFullScreen) {
document.webkitCancelFullScreen();
} else {