mirror of
https://github.com/lightsoutgames/godot-accessibility.git
synced 2024-11-21 19:45:55 +00:00
Add stub presentation for lists.
This commit is contained in:
parent
9c9c4c4af5
commit
70f8e1c98d
|
@ -2,12 +2,24 @@ extends Object
|
|||
|
||||
var node
|
||||
|
||||
func item_or_items(count):
|
||||
if count == 1:
|
||||
return "item"
|
||||
else:
|
||||
return "items"
|
||||
|
||||
func present_button():
|
||||
var text = "Unlabelled"
|
||||
if node.text:
|
||||
text = node.text
|
||||
print("%s: button" % text)
|
||||
|
||||
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 present_line_edit():
|
||||
var text = "blank"
|
||||
if node.secret:
|
||||
|
@ -21,12 +33,6 @@ func present_line_edit():
|
|||
type = "text"
|
||||
print("%s: %s" % [text, type])
|
||||
|
||||
func item_or_items(count):
|
||||
if count == 1:
|
||||
return "item"
|
||||
else:
|
||||
return "items"
|
||||
|
||||
func present_tree():
|
||||
var root = node.get_root()
|
||||
var count = 0
|
||||
|
@ -35,6 +41,8 @@ func present_tree():
|
|||
func focused():
|
||||
if node is Button:
|
||||
present_button()
|
||||
elif node is ItemList:
|
||||
present_item_list()
|
||||
elif node is LineEdit:
|
||||
present_line_edit()
|
||||
elif node is Tree:
|
||||
|
|
Loading…
Reference in New Issue
Block a user