mirror of
https://github.com/lightsoutgames/godot-accessibility.git
synced 2024-11-22 11:55:56 +00:00
Check node tree ancestry, rather than superclass ancestry, to associate an EditorProperty
with its label.
This commit is contained in:
parent
1f5a6a878f
commit
421dcbcf42
|
@ -30,6 +30,13 @@ func left_click(item := node):
|
||||||
click.pressed = false
|
click.pressed = false
|
||||||
node.get_tree().input_event(click)
|
node.get_tree().input_event(click)
|
||||||
|
|
||||||
|
func guess_label():
|
||||||
|
var parent = node.get_parent()
|
||||||
|
while parent:
|
||||||
|
if parent is EditorProperty and parent.label:
|
||||||
|
return parent.label
|
||||||
|
parent = parent.get_parent()
|
||||||
|
|
||||||
func close_key_event_dialog():
|
func close_key_event_dialog():
|
||||||
node.get_ok().emit_signal("pressed")
|
node.get_ok().emit_signal("pressed")
|
||||||
|
|
||||||
|
@ -310,9 +317,9 @@ func tab_container_input(event):
|
||||||
func focused():
|
func focused():
|
||||||
print("Focus: %s" % node)
|
print("Focus: %s" % node)
|
||||||
tts.stop()
|
tts.stop()
|
||||||
var parent = node.get_parent()
|
var label = guess_label()
|
||||||
if parent is EditorProperty and parent.label:
|
if label:
|
||||||
tts.speak(parent.label, false)
|
tts.speak(label, false)
|
||||||
if node is MenuButton:
|
if node is MenuButton:
|
||||||
menu_button_focus()
|
menu_button_focus()
|
||||||
elif node is AcceptDialog:
|
elif node is AcceptDialog:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user