Fixing Zoom/UnZoom with notebook pages

This commit is contained in:
Emmanuel Bretelle 2008-08-16 13:37:49 +01:00
parent 8ee6c682ca
commit e7c57039a4
1 changed files with 10 additions and 1 deletions

View File

@ -801,6 +801,8 @@ class Terminator:
if isinstance (widget, gtk.Window): if isinstance (widget, gtk.Window):
return None return None
parent = widget.get_parent() parent = widget.get_parent()
if parent is None:
return None
if isinstance (parent, gtk.Notebook): if isinstance (parent, gtk.Notebook):
page = -1 page = -1
for i in xrange(0, parent.get_n_pages()): for i in xrange(0, parent.get_n_pages()):
@ -828,6 +830,7 @@ class Terminator:
(isinstance(widget, TerminatorTerm) and isinstance(widget.get_parent(),gtk.Paned))\ (isinstance(widget, TerminatorTerm) and isinstance(widget.get_parent(),gtk.Paned))\
: :
widget._titlebox.show() widget._titlebox.show()
widget._vte.grab_focus() widget._vte.grab_focus()
def zoom_term (self, widget, fontscale = False): def zoom_term (self, widget, fontscale = False):
@ -903,9 +906,15 @@ class Terminator:
self.window.remove(widget) self.window.remove(widget)
self.window.add(self.window_child) self.window.add(self.window_child)
self.old_parent.add(widget)
if isinstance(self.old_parent, gtk.Notebook): if isinstance(self.old_parent, gtk.Notebook):
self.old_parent.insert_page(widget, None, self.old_page)
self.old_parent.set_tab_label(widget, TerminatorNotebookTabLabel("", self.old_parent, self))
self.old_parent.set_tab_label_packing(widget, True, True, gtk.PACK_START)
self.old_parent.set_tab_reorderable(widget, True)
self.old_parent.set_current_page(self.old_page) self.old_parent.set_current_page(self.old_page)
else:
self.old_parent.add(widget)
widget._vte.grab_focus () widget._vte.grab_focus ()