summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--library/console.tcl11
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 <patthoyts@users.sourceforge.net>
+ * 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 <<Console_FontSizeIncr>> {
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 <<Console_FontSizeDecr>> {
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
}
##