mirror of
https://github.com/lightsoutgames/godot-accessibility.git
synced 2024-12-22 07:35:56 +00:00
Rename present_* to focus_*.
This commit is contained in:
parent
8e06663529
commit
2c5babe103
|
@ -8,7 +8,7 @@ func item_or_items(count):
|
|||
else:
|
||||
return "items"
|
||||
|
||||
func present_button():
|
||||
func focus_button():
|
||||
var text = "Unlabelled"
|
||||
if node.text:
|
||||
text = node.text
|
||||
|
@ -16,6 +16,22 @@ func present_button():
|
|||
|
||||
var list_pos = 0
|
||||
|
||||
func focus_item_list():
|
||||
var count = node.get_item_count()
|
||||
var selected = node.get_selected_items()
|
||||
print("list, %s %s" % [count, item_or_items(count)])
|
||||
print(selected)
|
||||
|
||||
|
||||
func handle_item_list_item_selected(index):
|
||||
print("Selected")
|
||||
|
||||
func handle_item_list_multi_selected(index, selected):
|
||||
print("Multiselect")
|
||||
|
||||
func handle_item_list_nothing_selected():
|
||||
print("Nothing selected")
|
||||
|
||||
func input_item_list(event):
|
||||
var old_list_pos = list_pos
|
||||
if event.echo or not event.pressed:
|
||||
|
@ -36,26 +52,10 @@ func input_item_list(event):
|
|||
var text = node.get_item_text(list_pos)
|
||||
print("%s: %s of %s" % [text, list_pos+1, node.get_item_count()])
|
||||
|
||||
func handle_item_list_item_selected(index):
|
||||
print("Selected")
|
||||
|
||||
func handle_item_list_multi_selected(index, selected):
|
||||
print("Multiselect")
|
||||
|
||||
func handle_item_list_nothing_selected():
|
||||
print("Nothing selected")
|
||||
|
||||
func present_item_list():
|
||||
var count = node.get_item_count()
|
||||
var selected = node.get_selected_items()
|
||||
print("list, %s %s" % [count, item_or_items(count)])
|
||||
print(selected)
|
||||
|
||||
|
||||
func unfocus_item_list():
|
||||
list_pos = 0
|
||||
|
||||
func present_line_edit():
|
||||
func focus_line_edit():
|
||||
var text = "blank"
|
||||
if node.secret:
|
||||
text = "password"
|
||||
|
@ -86,20 +86,20 @@ func check_caret_moved():
|
|||
print(text[pos])
|
||||
old_pos = pos
|
||||
|
||||
func present_tree():
|
||||
func focus_tree():
|
||||
var root = node.get_root()
|
||||
var count = 0
|
||||
print("tree: %s %s" % [count, item_or_items(count)])
|
||||
|
||||
func focused():
|
||||
if node is Button:
|
||||
present_button()
|
||||
focus_button()
|
||||
elif node is ItemList:
|
||||
present_item_list()
|
||||
focus_item_list()
|
||||
elif node is LineEdit:
|
||||
present_line_edit()
|
||||
focus_line_edit()
|
||||
elif node is Tree:
|
||||
present_tree()
|
||||
focus_tree()
|
||||
else:
|
||||
print("Focus entered.", node)
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user