From d853863c8bbda281a220cea42a6e295b76ebc8ea Mon Sep 17 00:00:00 2001 From: patthoyts Date: Tue, 13 May 2008 13:25:17 +0000 Subject: Support pixel sized font in the +/- keybindings --- ChangeLog | 1 + library/console.tcl | 11 ++++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8846f59..14541db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2008-05-13 Pat Thoyts + * library/console.tcl: Support pixel sized font in +/- keybinding. * tests/listbox.test: -activestyle default is underline on windows. * tests/winDialog.test: Fixed hanging tk_chooseColor tests. diff --git a/library/console.tcl b/library/console.tcl index 6c176bc..cc38ca5 100644 --- a/library/console.tcl +++ b/library/console.tcl @@ -4,7 +4,7 @@ # can be used by non-unix systems that do not have built-in support # for shells. # -# RCS: @(#) $Id: console.tcl,v 1.37 2007/12/13 15:26:27 dgp Exp $ +# RCS: @(#) $Id: console.tcl,v 1.38 2008/05/13 13:25:18 patthoyts Exp $ # # Copyright (c) 1995-1997 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. @@ -554,11 +554,16 @@ proc ::tk::ConsoleBind {w} { } bind Console <> { set size [font configure TkConsoleFont -size] - font configure TkConsoleFont -size [incr size] + if {$size < 0} {set sign -1} else {set sign 1} + set size [expr {(abs($size) + 1) * $sign}] + font configure TkConsoleFont -size $size } bind Console <> { set size [font configure TkConsoleFont -size] - font configure TkConsoleFont -size [incr size -1] + if {abs($size) < 2} { return } + if {$size < 0} {set sign -1} else {set sign 1} + set size [expr {(abs($size) - 1) * $sign}] + font configure TkConsoleFont -size $size } ## -- cgit v0.12