mirror of
https://github.com/lightsoutgames/godot-accessibility.git
synced 2024-11-22 03:45:56 +00:00
Fix tree traversal bug
This commit is contained in:
parent
dced450b46
commit
fc475ae6b8
|
@ -263,11 +263,12 @@ func tree_item_deselect_all(item: TreeItem):
|
||||||
for i in range(node.columns):
|
for i in range(node.columns):
|
||||||
item.deselect(i)
|
item.deselect(i)
|
||||||
|
|
||||||
func tree_deselect_all_but(target: TreeItem, item: TreeItem):
|
func tree_deselect_all_but(target: TreeItem, tree: Tree):
|
||||||
var next = item.get_next_visible()
|
var cur = tree.get_root()
|
||||||
while next and next != item:
|
while cur != null:
|
||||||
tree_item_deselect_all(item)
|
if cur != target:
|
||||||
next = next.get_next_visible()
|
tree_item_deselect_all(cur)
|
||||||
|
cur = tree.get_next_selected(cur)
|
||||||
|
|
||||||
var prev_selected_cell
|
var prev_selected_cell
|
||||||
|
|
||||||
|
@ -279,7 +280,7 @@ func tree_item_selected():
|
||||||
if cell != prev_selected_cell:
|
if cell != prev_selected_cell:
|
||||||
if node.select_mode == Tree.SELECT_MULTI:
|
if node.select_mode == Tree.SELECT_MULTI:
|
||||||
cell.select(0)
|
cell.select(0)
|
||||||
tree_deselect_all_but(cell, node.get_root())
|
tree_deselect_all_but(cell, node)
|
||||||
if node.has_focus():
|
if node.has_focus():
|
||||||
tree_item_render()
|
tree_item_render()
|
||||||
prev_selected_cell = cell
|
prev_selected_cell = cell
|
||||||
|
|
Loading…
Reference in New Issue
Block a user