Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
soffice: Report keyboard-triggered font size change (nvaccess#17147)
Partially implements feature requests from nvaccess#6915 Summary of the issue: commit 46a3436 ("soffice: Report keyboard-triggered formatting toggles in Writer (nvaccess#16413)") implemented announcement of formatting changes triggered by keyboard shortcuts for formatting attributes whose state is represented by toggle buttons in Writer's formatting toolbar. Issue nvaccess#6915 requests announcement of further text formatting attributes that are not represented by simple toggle buttons. This includes decreasing/increasing the font size, which can be done using the Ctrl+[ and Ctrl+] shortcuts when using an English (US) UI and keyboard layout. Description of user facing changes When decreasing or increasing the font size in LibreOffice Writer using the corresponding keyboard shortcuts, NVDA announces the new font size. Description of development approach Extend the solution from the above-mentioned commit 46a3436 to not only cover toggle buttons, but also UI controls implementing the IAccessibleText interface and handle the gestures/keyboard shortcuts for changing the font size: Rename methods and variables introduced earlier to not have button-specific names. Extract some logic to helper methods/classes to avoid duplication in SymphonyButton and the newly introduced SymphonyText logic. Add Ctrl+[ and Ctrl+] to the list of keyboard gestures to handle. Add SymphonyText.event_valueChange override that announces the new value. This gets triggered when the value of the "Font Size" editable combobox in Writer's formatting toolbar changes after using the keyboard shortcut, and results in the new value being announced, e.g. "14 pt". This is comparable to the handling in SymphonyButton.event_stateChange introduced in the earlier above-mentioned commit. Increase the timeout for announcement of events from 0.15 to 2 seconds, as 0.15 seconds wasn't always sufficient when testing the new feature.
- Loading branch information