From e7c57039a48e93a1ad55a5470c760c383d73c76c Mon Sep 17 00:00:00 2001 From: Emmanuel Bretelle Date: Sat, 16 Aug 2008 13:37:49 +0100 Subject: [PATCH] Fixing Zoom/UnZoom with notebook pages --- terminatorlib/terminator.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/terminatorlib/terminator.py b/terminatorlib/terminator.py index 4fcd8c14..18e4ce2b 100755 --- a/terminatorlib/terminator.py +++ b/terminatorlib/terminator.py @@ -801,6 +801,8 @@ class Terminator: if isinstance (widget, gtk.Window): return None parent = widget.get_parent() + if parent is None: + return None if isinstance (parent, gtk.Notebook): page = -1 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))\ : widget._titlebox.show() + widget._vte.grab_focus() def zoom_term (self, widget, fontscale = False): @@ -903,9 +906,15 @@ class Terminator: self.window.remove(widget) self.window.add(self.window_child) - self.old_parent.add(widget) 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) + else: + self.old_parent.add(widget) + widget._vte.grab_focus ()