From b70ce07706d073a1e780da34ed79c2bd35eb704f Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Tue, 13 Sep 2011 13:14:11 -0500 Subject: [PATCH] Fix window/document sizing in firefox. Another firefox issue is that height: 100% is calculated as 100% of the containing element even when the containing element is the window. This means that the size of any sibling element shifts the window size down by that much and causes the vertical scroll bars to appear. This doesn't happen in Chrome. - So instead, put a pad element inside the noVNC_screen element that is the size of the control bar. This is hidden by the control bar, however, it causes things to be sized correctly. - Also, rename noVNC_defaultScreen to noVNC_logo. - Clean some style specification out of the HTML. --- include/base.css | 15 +++++++++------ include/ui.js | 6 +++--- vnc.html | 11 +++++++---- 3 files changed, 19 insertions(+), 13 deletions(-) diff --git a/include/base.css b/include/base.css index 246999fc..b3c76a06 100644 --- a/include/base.css +++ b/include/base.css @@ -80,7 +80,7 @@ html { } #noVNC_status_bar { - margin-top: 15px; + margin-top: 0px; padding: 0px; } @@ -88,7 +88,6 @@ html { font-size: 12px; padding-top: 4px; width:100%; - margin-top: 2px; } .VNC_status_button, #clipboardbutton, #connectbutton { @@ -131,8 +130,12 @@ html { /* Do not set width/height for VNC_screen or VNC_canvas or incorrect * scaling will occur. Canvas resizes to remote VNC settings */ +#noVNC_screen_pad { + margin: 0px; + padding: 0px; + height: 44px; +} #noVNC_screen { - margin-top:40px; text-align: center; display: table; width:100%; @@ -231,8 +234,8 @@ html { right:180px; } -/*Default noVNC screen.*/ -#noVNC_defaultScreen { +/*Default noVNC logo.*/ +#noVNC_logo { width:400px; margin-left:auto; margin-right:auto; @@ -249,7 +252,7 @@ html { 1px 1px 0 #000; } -#noVNC_defaultScreen span{ +#noVNC_logo span{ color:green; } diff --git a/include/ui.js b/include/ui.js index 102f547d..17afe8b3 100644 --- a/include/ui.js +++ b/include/ui.js @@ -307,7 +307,7 @@ updateState: function(rfb, state, oldstate, msg) { klass = "noVNC_status_normal"; break; case 'disconnected': - $D('noVNC_defaultScreen').style.display = "block"; + $D('noVNC_logo').style.display = "block"; c.value = "Connection"; c.onclick = UI.connectPanelbutton; case 'loaded': @@ -375,14 +375,14 @@ connect: function() { UI.rfb.connect(host, port, password); //Close dialog. setTimeout(UI.setBarPosition, 100); - $D('noVNC_defaultScreen').style.display = "none"; + $D('noVNC_logo').style.display = "none"; }, disconnect: function() { UI.closeSettingsMenu(); UI.rfb.disconnect(); - $D('noVNC_defaultScreen').style.display = "block"; + $D('noVNC_logo').style.display = "block"; UI.connSettingsOpen = false; UI.connectPanelbutton(); }, diff --git a/vnc.html b/vnc.html index e5956d10..c3fe5ddb 100644 --- a/vnc.html +++ b/vnc.html @@ -78,8 +78,8 @@ value="Settings" id="menuButton" onclick="UI.clickSettingsMenu();"> + value="Connection" class="VNC_status_button" + onclick="UI.connectPanelbutton()" /> @@ -135,13 +135,16 @@ +
-
+
+ +
Loading
-

no
VNC

+

no
VNC

Canvas not supported.