mirror of
https://github.com/lightsoutgames/godot-accessibility.git
synced 2024-11-24 21:05:57 +00:00
Minor cleanup.
* Reformat. * Prepend some method names with `_`. GDScript convention is that private methods begin with `_`, and I'm slowly changing them over time. * Speak that the user is focused on a button, not a texture button. That the button is a texture button is an implementation detail, and shouldn't change how they accessibly interact with or perceive it.
This commit is contained in:
parent
0a44f1397c
commit
fee1bc2b91
|
@ -116,7 +116,7 @@ func _button_focused():
|
||||||
spoke_hint_tooltip = true
|
spoke_hint_tooltip = true
|
||||||
tokens.append(node.hint_tooltip)
|
tokens.append(node.hint_tooltip)
|
||||||
else:
|
else:
|
||||||
tokens.append(get_graphical_button_text(node.icon))
|
tokens.append(_get_graphical_button_text(node.icon))
|
||||||
tokens.append("button")
|
tokens.append("button")
|
||||||
if node.disabled:
|
if node.disabled:
|
||||||
tokens.append("disabled")
|
tokens.append("disabled")
|
||||||
|
@ -136,7 +136,7 @@ func try_to_get_text_in_theme(theme, texture):
|
||||||
return ""
|
return ""
|
||||||
|
|
||||||
|
|
||||||
func get_graphical_button_text(texture):
|
func _get_graphical_button_text(texture):
|
||||||
var default_theme_copy = Theme.new()
|
var default_theme_copy = Theme.new()
|
||||||
default_theme_copy.copy_default_theme()
|
default_theme_copy.copy_default_theme()
|
||||||
var current = node
|
var current = node
|
||||||
|
@ -147,10 +147,11 @@ func get_graphical_button_text(texture):
|
||||||
current = current.get_parent_control()
|
current = current.get_parent_control()
|
||||||
return try_to_get_text_in_theme(default_theme_copy, texture)
|
return try_to_get_text_in_theme(default_theme_copy, texture)
|
||||||
|
|
||||||
func texturebutton_focused():
|
|
||||||
|
func _texturebutton_focused():
|
||||||
var tokens = PoolStringArray([])
|
var tokens = PoolStringArray([])
|
||||||
tokens.append(get_graphical_button_text(node.texture_normal))
|
tokens.append(_get_graphical_button_text(node.texture_normal))
|
||||||
tokens.append("texture button")
|
tokens.append("button")
|
||||||
TTS.speak(tokens.join(": "))
|
TTS.speak(tokens.join(": "))
|
||||||
|
|
||||||
|
|
||||||
|
@ -612,7 +613,7 @@ func focused():
|
||||||
elif node is TextEdit:
|
elif node is TextEdit:
|
||||||
text_edit_focus()
|
text_edit_focus()
|
||||||
elif node is TextureButton:
|
elif node is TextureButton:
|
||||||
texturebutton_focused()
|
_texturebutton_focused()
|
||||||
elif node is Tree:
|
elif node is Tree:
|
||||||
tree_focused()
|
tree_focused()
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user