From 2358893e15097e4c28ac8c9f5d6b9c1d0fea1bb4 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 10 Oct 2023 11:06:56 +0200 Subject: [PATCH] Use min word count of 1 for labels in message dialogs The minimum word count was reduced to 1 for non-dialogs in commit 6f6e5efa6810f2f5b0e44c7bf6b385dd6805641a Author: Joanmarie Diggs Date: Sun Apr 29 16:34:21 2018 -0400 Reduce minimum word requirement for non-dialog unrelated labels Do the same for message dialogs, since the whole text in message dialogs should be presented; not just labels with at least three words. This makes use of the newly introduced functionality to determine whether something is a message dialog, added in commit c1df22c21621619fa99a58be105cb3243072a48f Author: Joanmarie Diggs Date: Tue Oct 10 10:26:22 2023 +0200 Create is_message_dialog utility This makes the whole text in the word count dialog in LibreOffice Writer ("Tools" -> "Word Count") announced by Orca. As discussed in !174, there's still room for tweaking the way that the information further, since right now, information that is visually presented as a table is now presented as just a concatenation of the single labels ("cell" contents, but they're not exposed to AT-SPI as cells). Issue: #419 --- src/orca/speech_generator.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py index efef210e4..3553d39ae 100644 --- a/src/orca/speech_generator.py +++ b/src/orca/speech_generator.py @@ -663,7 +663,8 @@ class SpeechGenerator(generator.Generator): minimumWords = 1 role = args.get('role', AXObject.get_role(obj)) - if role in [Atspi.Role.DIALOG, Atspi.Role.PANEL]: + if role == Atspi.Role.PANEL or \ + (role == Atspi.Role.DIALOG and not AXUtilities.is_message_dialog(obj)): minimumWords = 3 labels = self._script.utilities.unrelatedLabels(obj, visibleOnly, minimumWords) -- GitLab