You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Initial editor accessibility.
This commit is contained in:
@@ -544,6 +544,14 @@ void GradientEdit::_notification(int p_what) {
|
||||
draw_spacing = BASE_SPACING * get_theme_default_base_scale();
|
||||
handle_width = BASE_HANDLE_WIDTH * get_theme_default_base_scale();
|
||||
} break;
|
||||
case NOTIFICATION_ACCESSIBILITY_UPDATE: {
|
||||
RID ae = get_accessibility_element();
|
||||
ERR_FAIL_COND(ae.is_null());
|
||||
|
||||
//TODO
|
||||
DisplayServer::get_singleton()->accessibility_update_set_role(ae, DisplayServer::AccessibilityRole::ROLE_STATIC_TEXT);
|
||||
DisplayServer::get_singleton()->accessibility_update_set_value(ae, TTR(vformat("The %s is not accessible at this time.", "Gradient editor")));
|
||||
} break;
|
||||
case NOTIFICATION_DRAW: {
|
||||
_redraw();
|
||||
} break;
|
||||
@@ -630,6 +638,7 @@ GradientEditor::GradientEditor() {
|
||||
|
||||
snap_button = memnew(Button);
|
||||
snap_button->set_tooltip_text(TTR("Toggle Grid Snap"));
|
||||
snap_button->set_accessibility_name(TTRC("Snap to Grid"));
|
||||
snap_button->set_toggle_mode(true);
|
||||
toolbar->add_child(snap_button);
|
||||
snap_button->connect(SceneStringName(toggled), callable_mp(this, &GradientEditor::_set_snap_enabled));
|
||||
@@ -637,6 +646,7 @@ GradientEditor::GradientEditor() {
|
||||
snap_count_edit = memnew(EditorSpinSlider);
|
||||
snap_count_edit->set_min(2);
|
||||
snap_count_edit->set_max(100);
|
||||
snap_count_edit->set_accessibility_name(TTRC("Grid Step"));
|
||||
snap_count_edit->set_value(DEFAULT_SNAP);
|
||||
snap_count_edit->set_custom_minimum_size(Size2(65 * EDSCALE, 0));
|
||||
toolbar->add_child(snap_count_edit);
|
||||
|
||||
Reference in New Issue
Block a user