improve the left arrow behaviour in treeview: select parent row when we cannot collapse row

This commit is contained in:
Yann Leboulanger 2012-04-17 15:40:24 +02:00
parent 27ca6e13c5
commit 40d5b2469d
1 changed files with 4 additions and 1 deletions

View File

@ -3441,9 +3441,12 @@ class RosterWindow:
return
path = list_of_paths[0]
iter_ = model.get_iter(path)
if model.iter_has_child(iter_):
if model.iter_has_child(iter_) and self.tree.row_expanded(path):
self.tree.collapse_row(path)
return True
elif len(path) > 1:
self.tree.set_cursor(path[:-1])
return True
elif event.keyval == gtk.keysyms.Right:
treeselection = self.tree.get_selection()
model, list_of_paths = treeselection.get_selected_rows()