From: Richard W.M. Jones Date: Tue, 29 Jan 2019 16:39:36 +0000 (+0000) Subject: Scale nbdraid canvas according to screen size. X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=84f4179cf8463bc7cb72423e4f43ced912699404;p=libguestfs-talks.git Scale nbdraid canvas according to screen size. --- diff --git a/2019-fosdem/nbdview/nbdraid.tcl b/2019-fosdem/nbdview/nbdraid.tcl index f594f29..95f0441 100755 --- a/2019-fosdem/nbdview/nbdraid.tcl +++ b/2019-fosdem/nbdview/nbdraid.tcl @@ -37,7 +37,14 @@ source "nbdcanvas.tcl" set blocksize 4096 set width 128 -set scale 2 + +# For 1024x768 and 1280x1024 use scale 1 +# For larger screens use scale 2 +if { [winfo screenheight .] > 1024 } { + set scale 2 +} else { + set scale 1 +} # This list is used to store all the RAID handles. set handles {}