Fix up titlebar related actions now the widget is called titlebox

This commit is contained in:
Chris Jones 2008-03-29 01:06:42 +00:00
parent 94302d9fbe
commit 5ea8776fce
1 changed files with 13 additions and 9 deletions

View File

@ -441,16 +441,20 @@ class TerminatorTerm:
return False return False
def do_scrollbar_toggle (self): def do_scrollbar_toggle (self):
if self._scrollbar.get_property ('visible'): self.toggle_widget_visibility (self._scrollbar)
self._scrollbar.hide ()
else:
self._scrollbar.show ()
def do_title_toggle (self): def do_title_toggle (self):
if self._title.get_property ('visible'): self.toggle_widget_visibility (self._titlebox)
self._title.hide ()
def toggle_widget_visibility (self, widget):
if not isinstance (widget, gtk.Widget):
raise TypeError
if widget.get_property ('visible'):
widget.hide ()
else: else:
self._title.show () widget.show ()
#keybindings for the individual splited terminals (affects only the #keybindings for the individual splited terminals (affects only the
#the selected terminal) #the selected terminal)
def on_vte_key_press (self, term, event): def on_vte_key_press (self, term, event):
@ -577,8 +581,8 @@ class TerminatorTerm:
item.connect ("toggled", lambda menu_item: self.do_scrollbar_toggle ()) item.connect ("toggled", lambda menu_item: self.do_scrollbar_toggle ())
menu.append (item) menu.append (item)
item = gtk.CheckMenuItem (_("Show Title")) item = gtk.CheckMenuItem (_("Show _titlebar"))
item.set_active (self._title.get_property ('visible')) item.set_active (self._titlebox.get_property ('visible'))
item.connect ("toggled", lambda menu_item: self.do_title_toggle ()) item.connect ("toggled", lambda menu_item: self.do_title_toggle ())
menu.append (item) menu.append (item)