mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Base accessibility API.
This commit is contained in:
parent
af2c713971
commit
b106dfd4f9
124 changed files with 7631 additions and 181 deletions
|
|
@ -81,6 +81,17 @@ Size2 CheckBox::get_minimum_size() const {
|
|||
|
||||
void CheckBox::_notification(int p_what) {
|
||||
switch (p_what) {
|
||||
case NOTIFICATION_ACCESSIBILITY_UPDATE: {
|
||||
RID ae = get_accessibility_element();
|
||||
ERR_FAIL_COND(ae.is_null());
|
||||
|
||||
if (is_radio()) {
|
||||
DisplayServer::get_singleton()->accessibility_update_set_role(ae, DisplayServer::AccessibilityRole::ROLE_RADIO_BUTTON);
|
||||
} else {
|
||||
DisplayServer::get_singleton()->accessibility_update_set_role(ae, DisplayServer::AccessibilityRole::ROLE_CHECK_BOX);
|
||||
}
|
||||
} break;
|
||||
|
||||
case NOTIFICATION_THEME_CHANGED:
|
||||
case NOTIFICATION_LAYOUT_DIRECTION_CHANGED:
|
||||
case NOTIFICATION_TRANSLATION_CHANGED: {
|
||||
|
|
@ -134,7 +145,7 @@ void CheckBox::_notification(int p_what) {
|
|||
}
|
||||
}
|
||||
|
||||
bool CheckBox::is_radio() {
|
||||
bool CheckBox::is_radio() const {
|
||||
return get_button_group().is_valid();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue