1
0
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:
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

@@ -87,12 +87,13 @@ private:
MessageType type;
Button *toggle_button = nullptr;
void initialize_button(const String &p_tooltip, Callable p_toggled_callback) {
void initialize_button(const String &p_name, const String &p_tooltip, Callable p_toggled_callback) {
toggle_button = memnew(Button);
toggle_button->set_toggle_mode(true);
toggle_button->set_pressed(true);
toggle_button->set_text(itos(message_count));
toggle_button->set_tooltip_text(TTR(p_tooltip));
toggle_button->set_accessibility_name(TTRGET(p_name));
toggle_button->set_tooltip_text(TTRGET(p_tooltip));
toggle_button->set_focus_mode(FOCUS_NONE);
// When toggled call the callback and pass the MessageType this button is for.
toggle_button->connect(SceneStringName(toggled), p_toggled_callback.bind(type));