1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +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

@@ -1154,6 +1154,7 @@ TextureRegionEditor::TextureRegionEditor() {
snap_mode_button = memnew(OptionButton);
hb_tools->add_child(snap_mode_button);
snap_mode_button->set_accessibility_name(TTRC("Snap Mode"));
snap_mode_button->add_item(TTR("None"), 0);
snap_mode_button->add_item(TTR("Pixel Snap"), 1);
snap_mode_button->add_item(TTR("Grid Snap"), 2);
@@ -1171,12 +1172,14 @@ TextureRegionEditor::TextureRegionEditor() {
sb_off_x->set_step(1);
sb_off_x->set_suffix("px");
sb_off_x->connect(SceneStringName(value_changed), callable_mp(this, &TextureRegionEditor::_set_snap_off_x));
sb_off_x->set_accessibility_name(TTRC("Offset X"));
hb_grid->add_child(sb_off_x);
sb_off_y = memnew(SpinBox);
sb_off_y->set_step(1);
sb_off_y->set_suffix("px");
sb_off_y->connect(SceneStringName(value_changed), callable_mp(this, &TextureRegionEditor::_set_snap_off_y));
sb_off_y->set_accessibility_name(TTRC("Offset Y"));
hb_grid->add_child(sb_off_y);
hb_grid->add_child(memnew(VSeparator));
@@ -1187,6 +1190,7 @@ TextureRegionEditor::TextureRegionEditor() {
sb_step_x->set_step(1);
sb_step_x->set_suffix("px");
sb_step_x->connect(SceneStringName(value_changed), callable_mp(this, &TextureRegionEditor::_set_snap_step_x));
sb_step_x->set_accessibility_name(TTRC("Step X"));
hb_grid->add_child(sb_step_x);
sb_step_y = memnew(SpinBox);
@@ -1194,6 +1198,7 @@ TextureRegionEditor::TextureRegionEditor() {
sb_step_y->set_step(1);
sb_step_y->set_suffix("px");
sb_step_y->connect(SceneStringName(value_changed), callable_mp(this, &TextureRegionEditor::_set_snap_step_y));
sb_step_y->set_accessibility_name(TTRC("Step Y"));
hb_grid->add_child(sb_step_y);
hb_grid->add_child(memnew(VSeparator));
@@ -1204,6 +1209,7 @@ TextureRegionEditor::TextureRegionEditor() {
sb_sep_x->set_step(1);
sb_sep_x->set_suffix("px");
sb_sep_x->connect(SceneStringName(value_changed), callable_mp(this, &TextureRegionEditor::_set_snap_sep_x));
sb_sep_x->set_accessibility_name(TTRC("Separation X"));
hb_grid->add_child(sb_sep_x);
sb_sep_y = memnew(SpinBox);
@@ -1211,6 +1217,7 @@ TextureRegionEditor::TextureRegionEditor() {
sb_sep_y->set_step(1);
sb_sep_y->set_suffix("px");
sb_sep_y->connect(SceneStringName(value_changed), callable_mp(this, &TextureRegionEditor::_set_snap_sep_y));
sb_sep_y->set_accessibility_name(TTRC("Separation Y"));
hb_grid->add_child(sb_sep_y);
hb_grid->hide();
@@ -1249,18 +1256,21 @@ TextureRegionEditor::TextureRegionEditor() {
zoom_out = memnew(Button);
zoom_out->set_flat(true);
zoom_out->set_tooltip_text(TTR("Zoom Out"));
zoom_out->set_accessibility_name(TTRC("Zoom Out"));
zoom_out->connect(SceneStringName(pressed), callable_mp(this, &TextureRegionEditor::_zoom_out));
zoom_hb->add_child(zoom_out);
zoom_reset = memnew(Button);
zoom_reset->set_flat(true);
zoom_reset->set_tooltip_text(TTR("Zoom Reset"));
zoom_reset->set_accessibility_name(TTRC("Reset Zoom"));
zoom_reset->connect(SceneStringName(pressed), callable_mp(this, &TextureRegionEditor::_zoom_reset));
zoom_hb->add_child(zoom_reset);
zoom_in = memnew(Button);
zoom_in->set_flat(true);
zoom_in->set_tooltip_text(TTR("Zoom In"));
zoom_in->set_accessibility_name(TTRC("Zoom In"));
zoom_in->connect(SceneStringName(pressed), callable_mp(this, &TextureRegionEditor::_zoom_in));
zoom_hb->add_child(zoom_in);