From cc77c3bc4e974bad4e29fc09f7fe90378beae67e Mon Sep 17 00:00:00 2001 From: Chris Jones Date: Tue, 2 Mar 2010 20:38:28 +0000 Subject: [PATCH] Drag and drop ordering continues to be insane. Refactor it so we're not double-negativing. This appears to fix everything about it --- terminatorlib/notebook.py | 7 +++---- terminatorlib/paned.py | 4 ++-- terminatorlib/window.py | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/terminatorlib/notebook.py b/terminatorlib/notebook.py index 051c559e..8919e2e7 100755 --- a/terminatorlib/notebook.py +++ b/terminatorlib/notebook.py @@ -64,7 +64,6 @@ class Notebook(Container, gtk.Notebook): err('incorrect number of children for Notebook: %s' % layout) return - pages = 2 # Notebooks always start with two pages num = 0 keys = children.keys() keys.sort() @@ -87,7 +86,7 @@ class Notebook(Container, gtk.Notebook): page.create_layout(children[child_key]) num = num + 1 - def split_axis(self, widget, vertical=True, sibling=None, widgetlast=False): + def split_axis(self, widget, vertical=True, sibling=None, widgetfirst=True): """Split the axis of a terminal inside us""" order = None page_num = self.page_num(widget) @@ -112,8 +111,8 @@ class Notebook(Container, gtk.Notebook): self.set_tab_label(container, label) self.show_all() - order = [sibling, widget] - if widgetlast is True: + order = [widget, sibling] + if widgetfirst is False: order.reverse() for terminal in order: diff --git a/terminatorlib/paned.py b/terminatorlib/paned.py index 6c59cce1..541ce7d3 100755 --- a/terminatorlib/paned.py +++ b/terminatorlib/paned.py @@ -41,7 +41,7 @@ class Paned(Container): # pylint: disable-msg=W0613 def split_axis(self, widget, vertical=True, sibling=None, - widgetlast=False): + widgetfirst=True): """Default axis splitter. This should be implemented by subclasses""" order = None @@ -61,7 +61,7 @@ class Paned(Container): self.show_all() order = [widget, sibling] - if widgetlast is False: + if widgetfirst is False: order.reverse() for terminal in order: diff --git a/terminatorlib/window.py b/terminatorlib/window.py index 102a250d..4f4fa62d 100755 --- a/terminatorlib/window.py +++ b/terminatorlib/window.py @@ -291,7 +291,7 @@ class Window(Container, gtk.Window): Container.closeterm(self, widget) self.hoover() - def split_axis(self, widget, vertical=True, sibling=None, widgetlast=False): + def split_axis(self, widget, vertical=True, sibling=None, widgetfirst=True): """Split the window""" order = None maker = Factory() @@ -308,8 +308,8 @@ class Window(Container, gtk.Window): self.add(container) container.show_all() - order = [sibling, widget] - if widgetlast is True: + order = [widget, sibling] + if widgetfirst is False: order.reverse() for term in order: