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 .B Ctrl+Shift+PageUp
Swap tab position with previous Tab Swap tab position with previous Tab
.TP .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 .B F11
Toggle fullscreen Toggle fullscreen
.SH "Drag and Drop" .SH "Drag and Drop"

View File

@ -39,7 +39,7 @@ TARGET_TYPE_VTE = 8
# import our configuration loader # import our configuration loader
from terminatorlib import config from terminatorlib import config
from terminatorlib.config import dbg from terminatorlib.config import dbg, err
#import encoding list #import encoding list
from terminatorlib.encoding import TerminatorEncoding from terminatorlib.encoding import TerminatorEncoding
@ -611,6 +611,9 @@ text/plain
elif keyname == 'minus': elif keyname == 'minus':
self.zoom (False) self.zoom (False)
return (True) return (True)
elif keyname == 'equal':
self.zoom_orig ()
return (True)
mask = gtk.gdk.CONTROL_MASK | gtk.gdk.SHIFT_MASK | gtk.gdk.MOD1_MASK mask = gtk.gdk.CONTROL_MASK | gtk.gdk.SHIFT_MASK | gtk.gdk.MOD1_MASK
if (event.state & mask) == mask: if (event.state & mask) == mask:
@ -690,6 +693,9 @@ text/plain
# if you intend to use it, reinit it # if you intend to use it, reinit it
return (False) return (False)
def zoom_orig (self):
self._vte.set_font (pango.FontDescription (self.conf.font))
def zoom (self, zoom_in): def zoom (self, zoom_in):
pangodesc = self._vte.get_font () pangodesc = self._vte.get_font ()
fontsize = pangodesc.get_size () fontsize = pangodesc.get_size ()