Skip to content

Commit

Permalink
Remove overriden arrow keys mappings for tree views
Browse files Browse the repository at this point in the history
  • Loading branch information
JCavallo committed Jan 2, 2017
1 parent f63477e commit 1b5e1e2
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions tryton/gui/window/view_form/view/list.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,43 +718,6 @@ def on_keypress(self, widget, event):
and event.state & control_mask):
self.on_paste()
return False
if event.keyval in (gtk.keysyms.Down, gtk.keysyms.Up):
path, column = widget.get_cursor()
if not path:
return False
model = widget.get_model()
if event.keyval == gtk.keysyms.Down:
test = True
for i in xrange(len(path)):
iter_ = model.get_iter(path[0:i + 1])
if model.iter_next(iter_):
test = False
if test:
iter_ = model.get_iter(path)
if (model.iter_has_child(iter_)
and widget.row_expanded(path)):
test = False
return test
elif event.keyval == gtk.keysyms.Up:
if path == (0,):
return True
if (event.keyval in (gtk.keysyms.Left, gtk.keysyms.Right)
and self.children_field):
selection = widget.get_selection()
model, paths = selection.get_selected_rows()
if event.keyval == gtk.keysyms.Left:
if len(paths) == 1:
path, = paths
if not widget.row_expanded(path):
path = path[:-1]
if path:
selection.select_path(path)
widget.collapse_row(path)
for path in paths:
widget.collapse_row(path)
elif event.keyval == gtk.keysyms.Right:
for path in paths:
widget.expand_row(path, False)

def test_expand_row(self, widget, iter_, path):
model = widget.get_model()
Expand Down

0 comments on commit 1b5e1e2

Please sign in to comment.