Make the terminal title updater aware of zooming, and show it when we're zoomed, saying that we're zoomed

This commit is contained in:
Chris Jones 2009-02-02 17:18:40 +00:00
parent 71156a487a
commit 859c463a48
2 changed files with 16 additions and 0 deletions

View File

@ -1248,6 +1248,7 @@ class Terminator:
widget._titlebox.show() widget._titlebox.show()
widget._vte.grab_focus() widget._vte.grab_focus()
widget._titlebox.update()
def zoom_term (self, widget, fontscale = False): def zoom_term (self, widget, fontscale = False):
"""Maximize to full window an instance of TerminatorTerm.""" """Maximize to full window an instance of TerminatorTerm."""

View File

@ -48,6 +48,7 @@ class TerminatorTermTitle (gtk.EventBox):
_hbox = None _hbox = None
_icon = None _icon = None
_parent = None _parent = None
_unzoomed_title = None
def __init__ (self, configwanted = False): def __init__ (self, configwanted = False):
gtk.EventBox.__init__ (self) gtk.EventBox.__init__ (self)
@ -83,6 +84,10 @@ class TerminatorTermTitle (gtk.EventBox):
"""Set the text shown in the titlebar""" """Set the text shown in the titlebar"""
self._title.set_text (name) self._title.set_text (name)
def get_terminal_title (self):
"""Return the text showin in the titlebar"""
return (self._title.get_text ())
def set_background_color (self, color): def set_background_color (self, color):
"""Set the background color of the titlebar""" """Set the background color of the titlebar"""
self.modify_bg (gtk.STATE_NORMAL, color) self.modify_bg (gtk.STATE_NORMAL, color)
@ -105,6 +110,16 @@ class TerminatorTermTitle (gtk.EventBox):
if not self._parent: if not self._parent:
self._parent = self.get_parent () self._parent = self.get_parent ()
if self._parent.terminator._zoomed and len (self._parent.terminator.term_list):
self._unzoomed_title = self.get_terminal_title ()
self.set_terminal_title ("Zoomed terminal, %d hidden" % (len (self._parent.terminator.term_list) - 1))
self.show()
return
else:
if self._unzoomed_title:
self.set_terminal_title (self._unzoomed_title)
self._unzoomed_title = None
if isinstance (self._parent.get_parent (), gtk.Window): if isinstance (self._parent.get_parent (), gtk.Window):
self.hide() self.hide()
return return