Drag and drop ordering continues to be insane. Refactor it so we're not double-negativing. This appears to fix everything about it

This commit is contained in:
Chris Jones 2010-03-02 20:38:28 +00:00
parent 8e0c5aacbc
commit cc77c3bc4e
3 changed files with 8 additions and 9 deletions

View File

@ -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:

View File

@ -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:

View File

@ -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: