From 92b2b43e92b617da2acf072afc4b1d4d8c01bb92 Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Wed, 18 Jun 2008 09:39:21 +0100 Subject: [PATCH] Add support for restoring original font size after zooming. Also import 'err' from terminatorlib --- doc/terminator.1 | 9 +++++++++ terminator | 8 +++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/doc/terminator.1 b/doc/terminator.1 index 8c4b35ae..4c349375 100644 --- a/doc/terminator.1 +++ b/doc/terminator.1 @@ -103,6 +103,15 @@ Swap tab position with next Tab .B Ctrl+Shift+PageUp Swap tab position with previous Tab .TP +.B Ctrl+Plus (+) +Increase font size +.TP +.B Ctrl+Minus (-) +Decrease font size +.TP +.B Ctrl+Equals (=) +Restore font size to original setting +.TP .B F11 Toggle fullscreen .SH "Drag and Drop" diff --git a/terminator b/terminator index bd19b5c2..92694a57 100755 --- a/terminator +++ b/terminator @@ -39,7 +39,7 @@ TARGET_TYPE_VTE = 8 # import our configuration loader from terminatorlib import config -from terminatorlib.config import dbg +from terminatorlib.config import dbg, err #import encoding list from terminatorlib.encoding import TerminatorEncoding @@ -611,6 +611,9 @@ text/plain elif keyname == 'minus': self.zoom (False) return (True) + elif keyname == 'equal': + self.zoom_orig () + return (True) mask = gtk.gdk.CONTROL_MASK | gtk.gdk.SHIFT_MASK | gtk.gdk.MOD1_MASK if (event.state & mask) == mask: @@ -690,6 +693,9 @@ text/plain # if you intend to use it, reinit it return (False) + def zoom_orig (self): + self._vte.set_font (pango.FontDescription (self.conf.font)) + def zoom (self, zoom_in): pangodesc = self._vte.get_font () fontsize = pangodesc.get_size ()