Add support for font zooming. Fixes LP #178792

This commit is contained in:
Chris Jones 2008-01-06 00:00:22 +00:00
parent c587ab508c
commit 91c5b61359

View File

@ -294,6 +294,13 @@ class TerminatorTerm:
elif keyname == 'V':
self._vte.paste_clipboard ()
return (True)
elif keyname == 'plus':
self.zoom (True)
return (True)
if keyname and (keyname == 'minus'):
if event.state == gtk.gdk.CONTROL_MASK:
self.zoom (False)
if keyname and (keyname == 'Tab' or keyname.endswith('_Tab')):
if event.state == gtk.gdk.CONTROL_MASK:
@ -305,6 +312,18 @@ class TerminatorTerm:
return (False)
def zoom (self, zoom_in):
pangodesc = self._vte.get_font ()
fontsize = pango.PIXELS (pangodesc.get_size ())
if fontsize > 1 and not zoom_in:
fontsize -= 1
elif zoom_in:
fontsize += 1
pangodesc.set_size (fontsize * pango.SCALE)
self._vte.set_font (pangodesc)
def on_vte_popup_menu (self, term):
self.do_popup ()