Skip to content

Commit fae0998

Browse files
committed
Merge pull request godotengine#105314 from bruvzg/ac_set_sep
Add separate editor accessibility mode setting.
2 parents 9ef04f8 + d6b1325 commit fae0998

File tree

4 files changed

+31
-7
lines changed

4 files changed

+31
-7
lines changed

doc/classes/EditorSettings.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -812,6 +812,13 @@
812812
Input accumulation can be disabled to get slightly more precise/reactive input at the cost of increased CPU usage.
813813
[b]Note:[/b] Input accumulation is [i]enabled[/i] by default.
814814
</member>
815+
<member name="interface/accessibility/accessibility_support" type="int" setter="" getter="">
816+
Editor accessibility support mode:
817+
- [b]Auto[/b] ([code]0[/code]): Accessibility support is enabled, but updates to the accessibility information are processed only if an assistive app (such as a screen reader or a Braille display) is active (default).
818+
- [b]Always Active[/b] ([code]1[/code]): Accessibility support is enabled, and updates to the accessibility information are always processed, regardless of the status of assistive apps.
819+
- [b]Disabled[/b] ([code]2[/code]): Accessibility support is fully disabled.
820+
[b]Note:[/b] Accessibility debugging tools, such as Accessibility Insights for Windows, Accessibility Inspector (macOS), or AT-SPI Browser (Linux/BSD) do not count as assistive apps. To test your project with these tools, use [b]Always Active[/b].
821+
</member>
815822
<member name="interface/editor/accept_dialog_cancel_ok_buttons" type="int" setter="" getter="">
816823
How to position the Cancel and OK buttons in the editor's [AcceptDialog]s. Different platforms have different standard behaviors for this, which can be overridden using this setting. This is useful if you use Godot both on Windows and macOS/Linux and your Godot muscle memory is stronger than your OS specific one.
817824
- [b]Auto[/b] follows the platform convention: OK first on Windows, KDE, and LXQt, Cancel first on macOS and other Linux desktop environments.

doc/classes/ProjectSettings.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -261,10 +261,10 @@
261261
<members>
262262
<member name="accessibility/general/accessibility_support" type="int" setter="" getter="" default="0">
263263
Accessibility support mode:
264-
- [b]Auto[/b] ([code]0[/code]): accessibility support is enabled, but accessibility information updates are processed only if an assistive app (e.g. screen reader or Braille display) is active (default).
265-
- [b]Always Active[/b] ([code]1[/code]): accessibility support is enabled, and accessibility information updates are processed regardless of current assistive apps' status.
266-
- [b]Disabled[/b] ([code]2[/code]): accessibility support is fully disabled.
267-
[b]Note:[/b] Accessibility debugging tools, such as Accessibility Insights for Windows, macOS Accessibility Inspector, or AT-SPI Browser do not count as assistive apps. To test your app with these tools, use [code]1[/code].
264+
- [b]Auto[/b] ([code]0[/code]): Accessibility support is enabled, but updates to the accessibility information are processed only if an assistive app (such as a screen reader or a Braille display) is active (default).
265+
- [b]Always Active[/b] ([code]1[/code]): Accessibility support is enabled, and updates to the accessibility information are always processed, regardless of the status of assistive apps.
266+
- [b]Disabled[/b] ([code]2[/code]): Accessibility support is fully disabled.
267+
[b]Note:[/b] Accessibility debugging tools, such as Accessibility Insights for Windows, Accessibility Inspector (macOS), or AT-SPI Browser (Linux/BSD) do not count as assistive apps. To test your project with these tools, use [b]Always Active[/b].
268268
</member>
269269
<member name="accessibility/general/updates_per_second" type="int" setter="" getter="" default="60">
270270
The number of accessibility information updates per second.

editor/editor_settings.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -568,6 +568,9 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {
568568
open_in_new_inspector_defaults.push_back("MeshLibrary");
569569
_initial_set("interface/inspector/resources_to_open_in_new_inspector", open_in_new_inspector_defaults);
570570

571+
EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "interface/accessibility/accessibility_support", 0, "Auto (When Screen Reader is Running),Always Active,Disabled")
572+
set_restart_if_changed("interface/accessibility/accessibility_support", true);
573+
571574
EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "interface/inspector/default_color_picker_mode", (int32_t)ColorPicker::MODE_RGB, "RGB,HSV,RAW,OKHSL")
572575
EDITOR_SETTING_BASIC(Variant::INT, PROPERTY_HINT_ENUM, "interface/inspector/default_color_picker_shape", (int32_t)ColorPicker::SHAPE_OKHSL_CIRCLE, "HSV Rectangle,HSV Rectangle Wheel,VHS Circle,OKHSL Circle,OK HS Rectangle:5,OK HL Rectangle") // `SHAPE_NONE` is 4.
573576
EDITOR_SETTING_BASIC(Variant::BOOL, PROPERTY_HINT_NONE, "interface/inspector/color_picker_show_intensity", true, "");

main/main.cpp

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2909,6 +2909,7 @@ Error Main::setup2(bool p_show_boot_logo) {
29092909
print_header(false);
29102910

29112911
#ifdef TOOLS_ENABLED
2912+
int accessibility_mode_editor = 0;
29122913
int tablet_driver_editor = -1;
29132914
if (editor || project_manager || cmdline_tool) {
29142915
OS::get_singleton()->benchmark_begin_measure("Startup", "Initialize Early Settings");
@@ -2946,6 +2947,8 @@ Error Main::setup2(bool p_show_boot_logo) {
29462947

29472948
bool tablet_found = false;
29482949

2950+
bool ac_found = false;
2951+
29492952
if (editor) {
29502953
screen_property = "interface/editor/editor_screen";
29512954
} else if (project_manager) {
@@ -2960,7 +2963,7 @@ Error Main::setup2(bool p_show_boot_logo) {
29602963
prefer_wayland_found = true;
29612964
}
29622965

2963-
while (!screen_found || !prefer_wayland_found || !tablet_found) {
2966+
while (!screen_found || !prefer_wayland_found || !tablet_found || !ac_found) {
29642967
assign = Variant();
29652968
next_tag.fields.clear();
29662969
next_tag.name = String();
@@ -2979,7 +2982,10 @@ Error Main::setup2(bool p_show_boot_logo) {
29792982
restore_editor_window_layout = value.operator int() == EditorSettings::InitialScreen::INITIAL_SCREEN_AUTO;
29802983
}
29812984
}
2982-
if (assign == "interface/editor/expand_to_title") {
2985+
if (assign == "interface/accessibility/accessibility_support") {
2986+
accessibility_mode_editor = value;
2987+
ac_found = true;
2988+
} else if (assign == "interface/editor/expand_to_title") {
29832989
init_expand_to_title = value;
29842990
} else if (assign == "interface/editor/display_scale") {
29852991
init_display_scale = value;
@@ -3154,7 +3160,15 @@ Error Main::setup2(bool p_show_boot_logo) {
31543160
#endif
31553161

31563162
if (!accessibility_mode_set) {
3157-
accessibility_mode = (DisplayServer::AccessibilityMode)GLOBAL_GET("accessibility/general/accessibility_support").operator int64_t();
3163+
#ifdef TOOLS_ENABLED
3164+
if (editor || project_manager || cmdline_tool) {
3165+
accessibility_mode = (DisplayServer::AccessibilityMode)accessibility_mode_editor;
3166+
} else {
3167+
#else
3168+
{
3169+
#endif
3170+
accessibility_mode = (DisplayServer::AccessibilityMode)GLOBAL_GET("accessibility/general/accessibility_support").operator int64_t();
3171+
}
31583172
}
31593173
DisplayServer::accessibility_set_mode(accessibility_mode);
31603174

0 commit comments

Comments
 (0)