fix a typo in a previous commit, and remove all references to get_box()
This commit is contained in:
parent
78ca918f74
commit
549f046904
43
terminator
43
terminator
|
@ -100,7 +100,7 @@ class TerminatorTerm (gtk.VBox):
|
||||||
self._title.show()
|
self._title.show()
|
||||||
self._titlebox = gtk.EventBox()
|
self._titlebox = gtk.EventBox()
|
||||||
self._titlebox.add(self._title)
|
self._titlebox.add(self._title)
|
||||||
self..show()
|
self.show()
|
||||||
self.pack_start(self._titlebox, False)
|
self.pack_start(self._titlebox, False)
|
||||||
self.pack_start(self._termbox)
|
self.pack_start(self._termbox)
|
||||||
if len(self.terminator.term_list) > 0 and self.conf.titlebars:
|
if len(self.terminator.term_list) > 0 and self.conf.titlebars:
|
||||||
|
@ -562,9 +562,6 @@ class TerminatorTerm (gtk.VBox):
|
||||||
if vte.get_window_title ():
|
if vte.get_window_title ():
|
||||||
self.terminator.set_window_title("%s: %s" %(APP_NAME.capitalize(), vte.get_window_title ()))
|
self.terminator.set_window_title("%s: %s" %(APP_NAME.capitalize(), vte.get_window_title ()))
|
||||||
|
|
||||||
def get_box (self):
|
|
||||||
return self
|
|
||||||
|
|
||||||
class Terminator:
|
class Terminator:
|
||||||
def __init__ (self, profile, command = None, fullscreen = False, maximise = False, borderless = False):
|
def __init__ (self, profile, command = None, fullscreen = False, maximise = False, borderless = False):
|
||||||
self.profile = profile
|
self.profile = profile
|
||||||
|
@ -622,7 +619,7 @@ class Terminator:
|
||||||
term = (TerminatorTerm (self, self.profile, self.command))
|
term = (TerminatorTerm (self, self.profile, self.command))
|
||||||
self.term_list = [term]
|
self.term_list = [term]
|
||||||
|
|
||||||
self.window.add (term.get_box ())
|
self.window.add (term)
|
||||||
self.window.show ()
|
self.window.show ()
|
||||||
|
|
||||||
def maximize (self):
|
def maximize (self):
|
||||||
|
@ -708,14 +705,14 @@ class Terminator:
|
||||||
pane = (vertical) and gtk.VPaned () or gtk.HPaned ()
|
pane = (vertical) and gtk.VPaned () or gtk.HPaned ()
|
||||||
|
|
||||||
# get the parent of the provided terminal
|
# get the parent of the provided terminal
|
||||||
parent = widget.get_box ().get_parent ()
|
parent = widget.get_parent ()
|
||||||
|
|
||||||
if isinstance (parent, gtk.Window):
|
if isinstance (parent, gtk.Window):
|
||||||
# We have just one term
|
# We have just one term
|
||||||
widget.get_box ().reparent (pane)
|
widget.reparent (pane)
|
||||||
|
|
||||||
pane.pack1 (widget.get_box (), True, True)
|
pane.pack1 (widget, True, True)
|
||||||
pane.pack2 (terminal.get_box (), True, True)
|
pane.pack2 (terminal, True, True)
|
||||||
|
|
||||||
parent.add (pane)
|
parent.add (pane)
|
||||||
|
|
||||||
|
@ -724,23 +721,23 @@ class Terminator:
|
||||||
|
|
||||||
if isinstance (parent, gtk.Paned):
|
if isinstance (parent, gtk.Paned):
|
||||||
# We are inside a split term
|
# We are inside a split term
|
||||||
position = (vertical) and widget.get_box().allocation.height \
|
position = (vertical) and widget.allocation.height \
|
||||||
or widget.get_box().allocation.width
|
or widget.allocation.width
|
||||||
|
|
||||||
if (widget.get_box () == parent.get_child1 ()):
|
if (widget == parent.get_child1 ()):
|
||||||
widget.get_box ().reparent (pane)
|
widget.reparent (pane)
|
||||||
parent.pack1 (pane, True, True)
|
parent.pack1 (pane, True, True)
|
||||||
else:
|
else:
|
||||||
widget.get_box ().reparent (pane)
|
widget.reparent (pane)
|
||||||
parent.pack2 (pane, True, True)
|
parent.pack2 (pane, True, True)
|
||||||
|
|
||||||
pane.pack1 (widget.get_box (), True, True)
|
pane.pack1 (widget, True, True)
|
||||||
pane.pack2 (terminal.get_box (), True, True)
|
pane.pack2 (terminal, True, True)
|
||||||
|
|
||||||
# show all, set position of the divider
|
# show all, set position of the divider
|
||||||
pane.show ()
|
pane.show ()
|
||||||
pane.set_position (position / 2)
|
pane.set_position (position / 2)
|
||||||
terminal.get_box ().show ()
|
terminal.show ()
|
||||||
|
|
||||||
# insert the term reference into the list
|
# insert the term reference into the list
|
||||||
index = self.term_list.index (widget)
|
index = self.term_list.index (widget)
|
||||||
|
@ -752,7 +749,7 @@ class Terminator:
|
||||||
return (terminal)
|
return (terminal)
|
||||||
|
|
||||||
def closeterm (self, widget):
|
def closeterm (self, widget):
|
||||||
parent = widget.get_box ().get_parent ()
|
parent = widget.get_parent ()
|
||||||
sibling = None
|
sibling = None
|
||||||
|
|
||||||
if isinstance (parent, gtk.Window):
|
if isinstance (parent, gtk.Window):
|
||||||
|
@ -766,9 +763,9 @@ class Terminator:
|
||||||
grandparent = parent.get_parent ()
|
grandparent = parent.get_parent ()
|
||||||
|
|
||||||
# Discover sibling while all objects exist
|
# Discover sibling while all objects exist
|
||||||
if widget.get_box () == parent.get_child1 ():
|
if widget == parent.get_child1 ():
|
||||||
sibling = parent.get_child2 ()
|
sibling = parent.get_child2 ()
|
||||||
if widget.get_box () == parent.get_child2 ():
|
if widget == parent.get_child2 ():
|
||||||
sibling = parent.get_child1 ()
|
sibling = parent.get_child1 ()
|
||||||
|
|
||||||
if not sibling:
|
if not sibling:
|
||||||
|
@ -779,12 +776,12 @@ class Terminator:
|
||||||
self.term_list.remove (widget)
|
self.term_list.remove (widget)
|
||||||
grandparent.remove (parent)
|
grandparent.remove (parent)
|
||||||
sibling.reparent (grandparent)
|
sibling.reparent (grandparent)
|
||||||
widget.get_box ().destroy ()
|
widget.destroy ()
|
||||||
parent.destroy ()
|
parent.destroy ()
|
||||||
|
|
||||||
if not isinstance (sibling, gtk.Paned):
|
if not isinstance (sibling, gtk.Paned):
|
||||||
for term in self.term_list:
|
for term in self.term_list:
|
||||||
if term.get_box () == sibling:
|
if term == sibling:
|
||||||
term._vte.grab_focus ()
|
term._vte.grab_focus ()
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
|
@ -826,7 +823,7 @@ class Terminator:
|
||||||
vertical = False
|
vertical = False
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
parent = self.get_first_parent_paned(widget.get_box (),vertical)
|
parent = self.get_first_parent_paned(widget,vertical)
|
||||||
if parent == None:
|
if parent == None:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue