[Spice-devel] [PATCH spice-html5 3/3] Add checkbox to toggle debug console

Jeremy White jwhite at codeweavers.com
Thu May 25 18:05:29 UTC 2017


Hi Tomáš,

On 05/23/2017 07:03 AM, Tomáš Bohdálek wrote:
> This allows show or hide debug console under spice screen.
> ---
>  resize.js  | 12 ++++++++++--
>  spice.html | 18 ++++++++++++++++++
>  2 files changed, 28 insertions(+), 2 deletions(-)
> 
> diff --git a/resize.js b/resize.js
> index 89b59ff..481b22f 100644
> --- a/resize.js
> +++ b/resize.js
> @@ -44,8 +44,16 @@ function resize_helper(sc)
>           at the bottom, and use the position of the message window
>           to figure out how to resize */
>  
> -    /* Show both div elements - spice-area and message-div */
> -    var h = window.innerHeight - m.offsetHeight - m.clientHeight - 20;
> +    /* Screen height based on debug console visibility  */
> +    if (window.getComputedStyle(m).getPropertyValue("display") == 'none')
> +    {
> +        var h = window.innerHeight - 70;

Could we also get the '50' out of the CSS to be more rigorous?
(Arguably, the 20 should be eliminated as a magic number, but I won't
obligate you to clean up *all* of my mess <grin>).

The patch otherwise looks good to me.

And thanks for the patches, btw!

Cheers,

Jeremy



More information about the Spice-devel mailing list