Permalink
Browse files

Fix overlay resizing issues

  • Loading branch information...
Manuel-777 committed Jan 22, 2019
1 parent 3b79979 commit 88c6b1b999da44adec3c9eca6d95df5d9a84cb2f
Showing with 15 additions and 65 deletions.
  1. +4 −0 shared/shared.css
  2. +8 −9 window_overlay/index.css
  3. +3 −56 window_overlay/overlay.js
@@ -386,6 +386,9 @@ label {
overflow: hidden;
height: calc(100% - 4px);
width: calc(100% - 4px);
display: flex;
flex-direction: column;
justify-content: space-between;
-webkit-backface-visibility: hidden;
}

@@ -410,6 +413,7 @@ label {
position: relative;
z-index: 30;
height: 32px;
min-height: 32px;
background-color: rgba(145,121,97,0.6);
display: flex;
justify-content: space-between;
@@ -9,8 +9,9 @@ body {pointer-events: none}

.overlay_decklist {
padding-left: 2px;
height: calc(100% - 210px);
overflow: overlay;
overflow-x: hidden;
overflow-y: auto;
flex-grow: 2;
}

.overlay_decklist a {
@@ -68,13 +69,13 @@ body {pointer-events: none}
}

.overlay_clock_container {
-webkit-app-region:drag;
position: absolute;
-webkit-app-region: drag;
position: relative;
display: flex;
flex-direction: column;
bottom: 0;
float: center;
width: 100%;
min-height: 64px;
height: 64px;
z-index: 40;
background-color: rgba(0,0,0,0.5);
@@ -86,9 +87,9 @@ body {pointer-events: none}
flex-direction: column;
justify-content: space-around;
bottom: 0;
float: center;
width: 100%;
height: 64px;
min-height: 64px;
top: 64px;
z-index: 40;
}
@@ -100,16 +101,14 @@ body {pointer-events: none}
display: flex;
justify-content: space-between;
bottom: 0;
float: center;
width: 100%;
height: 64px;
top: 64px;
z-index: 40;
}


.chance_title {
font-size: 15px;
font-size: 14px;
height: 20px;
line-height: 20px;
margin: 0px auto;
@@ -160,23 +160,6 @@ ipc.on('set_db', function (event, arg) {
//
ipc.on('set_timer', function (event, arg) {
if (arg == -1) {
$(".overlay_clock_container").hide();
$(".overlay_deck_container").hide();
$(".overlay_draft_container").show();
$(".overlay_draft_container").css("display", "flex");


let _height = 114;
if ($('.top').css('display') == 'none') {
_height -= 32;
}
if ($('.overlay_deckname').css('display') == 'none') {
_height -= 78;
}
if ($('.overlay_clock_container').css('display') == 'none') {
_height -= 64;
}
$(".overlay_decklist").css("height", "100%").css("height", "-="+_height+"px");
overlayMode = 1;
matchBeginTime = Date.now();
}
@@ -193,30 +176,6 @@ ipc.on('set_priority_timer', function(event, arg) {
}
});

$( window ).resize(function() {
let _height = 178//114;
if ($('.top').css('display') == 'none') {
_height -= 32;
}
if ($('.overlay_deckname').css('display') == 'none') {
_height -= 78;
}
if ($('.overlay_clock_container').css('display') == 'none') {
_height -= 64;
}
if (overlayMode == 1) {
_height += 64;
}
$(".overlay_decklist").css("height", "100%").css("height", "-="+_height+"px");
/*
var bounds = remote.getCurrentWindow().webContents.getOwnerBrowserWindow().getBounds()
var w = Math.min(bounds.width, 256);
var sc = w / 256;
webFrame.setZoomFactor(sc);
*/
});


ipc.on('action_log', function (event, arg) {
actionLog.push(arg);
if (arg.seat == -99) {
@@ -289,21 +248,6 @@ ipc.on('set_settings', function (event, settings) {
if (!settings.overlay_clock || overlayMode == 1) {
hideDiv('.overlay_clock_container');
}

let _height = 174;
if (overlayMode == 1) {
_height = 110;
}
if (!settings.overlay_top) {
_height -= 32;
}
if (!settings.overlay_title) {
_height -= 78;
}
if (!settings.overlay_clock) {
_height -= 64;
}
$(".overlay_decklist").css("height", "100%").css("height", "-="+_height+"px");
});

function hideDiv(div) {
@@ -350,6 +294,9 @@ ipc.on('set_deck', function (event, arg) {
}
changedMode = true;

$(".overlay_deck_container").show();
$(".overlay_draft_container").hide();

$(".overlay_decklist").html('');
$(".overlay_deckcolors").html('');
currentDeck = arg;

0 comments on commit 88c6b1b

Please sign in to comment.