Add support for restoring original font size after zooming. Also import 'err' from terminatorlib

This commit is contained in:
Chris Jones 2008-06-18 09:39:21 +01:00
parent 5254ede2da
commit 92b2b43e92
2 changed files with 16 additions and 1 deletions

View File

@ -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"

View File

@ -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 ()