Makes the Insert terminal number order more sane in complex layouts
This commit is contained in:
parent
9e13bb6aae
commit
966c6ca104
@ -322,8 +322,13 @@ class Terminator(Borg):
|
||||
else:
|
||||
numstr = '%d'
|
||||
|
||||
terminals = []
|
||||
for window in self.windows:
|
||||
containers, win_terminals = enumerate_descendants(window)
|
||||
terminals.extend(win_terminals)
|
||||
|
||||
for term in self.get_target_terms(widget):
|
||||
idx = self.terminals.index(term)
|
||||
idx = terminals.index(term)
|
||||
term.feed(numstr % (idx + 1))
|
||||
|
||||
def get_target_terms(self, widget):
|
||||
|
@ -268,7 +268,7 @@ def enumerate_descendants(parent):
|
||||
terminals.append(descendant)
|
||||
|
||||
while len(containerstmp) > 0:
|
||||
child = containerstmp.pop()
|
||||
child = containerstmp.pop(0)
|
||||
for descendant in child.get_children():
|
||||
if maker.isinstance(descendant, 'Container'):
|
||||
containerstmp.append(descendant)
|
||||
|
Loading…
Reference in New Issue
Block a user