1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-10 13:00:37 +00:00

Initial editor accessibility.

This commit is contained in:
Pāvels Nadtočajevs
2025-03-21 09:55:22 +02:00
parent 4310cb82b8
commit 302fa831cc
137 changed files with 1544 additions and 93 deletions

View File

@@ -701,7 +701,7 @@ Variant Skeleton3DEditor::get_drag_data_fw(const Point2 &p_point, Control *p_fro
}
bool Skeleton3DEditor::can_drop_data_fw(const Point2 &p_point, const Variant &p_data, Control *p_from) const {
TreeItem *target = joint_tree->get_item_at_position(p_point);
TreeItem *target = (p_point == Vector2(INFINITY, INFINITY)) ? joint_tree->get_selected() : joint_tree->get_item_at_position(p_point);
if (!target) {
return false;
}
@@ -729,7 +729,7 @@ void Skeleton3DEditor::drop_data_fw(const Point2 &p_point, const Variant &p_data
return;
}
TreeItem *target = joint_tree->get_item_at_position(p_point);
TreeItem *target = (p_point == Vector2(INFINITY, INFINITY)) ? joint_tree->get_selected() : joint_tree->get_item_at_position(p_point);
TreeItem *selected = Object::cast_to<TreeItem>(Dictionary(p_data)["node"]);
const BoneId target_boneidx = String(target->get_metadata(0)).get_slicec('/', 1).to_int();
@@ -1026,6 +1026,7 @@ void Skeleton3DEditor::create_editors() {
edit_mode_button->set_toggle_mode(true);
edit_mode_button->set_focus_mode(FOCUS_NONE);
edit_mode_button->set_tooltip_text(TTR("Edit Mode\nShow buttons on joints."));
edit_mode_button->set_accessibility_name(TTRC("Edit Mode"));
edit_mode_button->connect(SceneStringName(toggled), callable_mp(this, &Skeleton3DEditor::edit_mode_toggled));
edit_mode = false;
@@ -1047,6 +1048,7 @@ void Skeleton3DEditor::create_editors() {
key_loc_button->set_pressed(false);
key_loc_button->set_focus_mode(FOCUS_NONE);
key_loc_button->set_tooltip_text(TTR("Translation mask for inserting keys."));
key_loc_button->set_accessibility_name(TTRC("Translation Mask"));
animation_hb->add_child(key_loc_button);
key_rot_button = memnew(Button);
@@ -1055,6 +1057,7 @@ void Skeleton3DEditor::create_editors() {
key_rot_button->set_pressed(true);
key_rot_button->set_focus_mode(FOCUS_NONE);
key_rot_button->set_tooltip_text(TTR("Rotation mask for inserting keys."));
key_rot_button->set_accessibility_name(TTRC("Rotation Mask"));
animation_hb->add_child(key_rot_button);
key_scale_button = memnew(Button);
@@ -1063,6 +1066,7 @@ void Skeleton3DEditor::create_editors() {
key_scale_button->set_pressed(false);
key_scale_button->set_focus_mode(FOCUS_NONE);
key_scale_button->set_tooltip_text(TTR("Scale mask for inserting keys."));
key_scale_button->set_accessibility_name(TTRC("Scale Mask"));
animation_hb->add_child(key_scale_button);
key_insert_button = memnew(Button);
@@ -1071,6 +1075,7 @@ void Skeleton3DEditor::create_editors() {
key_insert_button->connect(SceneStringName(pressed), callable_mp(this, &Skeleton3DEditor::insert_keys).bind(false));
key_insert_button->set_tooltip_text(TTRC("Insert key (based on mask) for bones with an existing track."));
key_insert_button->set_shortcut(ED_SHORTCUT("skeleton_3d_editor/insert_key_to_existing_tracks", TTRC("Insert Key (Existing Tracks)"), Key::INSERT));
key_insert_button->set_accessibility_name(TTRC("Insert Key"));
animation_hb->add_child(key_insert_button);
key_insert_all_button = memnew(Button);
@@ -1078,6 +1083,7 @@ void Skeleton3DEditor::create_editors() {
key_insert_all_button->set_focus_mode(FOCUS_NONE);
key_insert_all_button->connect(SceneStringName(pressed), callable_mp(this, &Skeleton3DEditor::insert_keys).bind(true));
key_insert_all_button->set_tooltip_text(TTRC("Insert key (based on mask) for all bones."));
key_insert_all_button->set_accessibility_name(TTRC("Insert Key for All Bones"));
key_insert_all_button->set_shortcut(ED_SHORTCUT("skeleton_3d_editor/insert_key_of_all_bones", TTRC("Insert Key (All Bones)"), KeyModifierMask::CMD_OR_CTRL + Key::INSERT));
animation_hb->add_child(key_insert_all_button);