Speak expanded/collapsed state of TreeItem immediately after its name.

This commit is contained in:
Nolan Darilek 2020-06-09 13:27:53 -05:00
parent 8ee1c05512
commit 10a080ab99

View File

@ -349,6 +349,11 @@ func _tree_item_render():
var column_text = cell.get_text(i) var column_text = cell.get_text(i)
if column_text: if column_text:
tokens.append(column_text) tokens.append(column_text)
if cell.get_children():
if cell.collapsed:
tokens.append("collapsed")
else:
tokens.append("expanded")
var button_count = cell.get_button_count(i) var button_count = cell.get_button_count(i)
if button_count != 0: if button_count != 0:
button_index = 0 button_index = 0
@ -365,11 +370,6 @@ func _tree_item_render():
tokens.append("button") tokens.append("button")
if button_count > 1: if button_count > 1:
tokens.append("Use Home and End to switch focus.") tokens.append("Use Home and End to switch focus.")
if cell.get_children():
if cell.collapsed:
tokens.append("collapsed")
else:
tokens.append("expanded")
tokens.append("tree item") tokens.append("tree item")
if tokens != _last_tree_item_tokens: if tokens != _last_tree_item_tokens:
TTS.speak(tokens.join(": "), true) TTS.speak(tokens.join(": "), true)