Anki/qt/aqt
Rastislav Kish e985fec9c4
A11Y: Improve the accessibility of the Preferences dialog (#3255)
* Configure buddy widgets for labels in the Preferences dialog

Labels are often used to describe the purpose of a different widget like a combobox, edit field or a spinbox by providing a textual name for their functionality. The relation between a label and a widget is typically expressed by placing the label next to the relevant object. In addition to this visual linking intended for human users, frameworks usually also offer semantic way to link labels with other widgets, so the relation can be noticed by programs like screenreaders, which can figure out the correct textual description for the focused widgets based on this information.

By default, labels on their own are not focusable elements, so users dependend on keyboard navigation and speech get to notice only the widget types (textbox, spinbox, etc.) while moving around without any contextual information if labels are not linked. When the linking is done, the component names get included as well.

QT provides the "buddy" property for QLabel, which creates a semantic link between the label and its buddy widget.

This commit configures the buddy properties on labels of the Anki Preferences dialog.

* Configure spinbox suffixes in Preferrences dialog

QSpinBox provides a suffix property. This property makes it possible to display a measurement unit next to the component value, which is linked to it both visually and semantically for the GUI framework without affecting the spinbox value itself. For purposes of accessibility, it's better to use this property than simply place a label next to the component, since it can be directly accessed by screenreaders and other assistive technology.

This commit configures suffix properties for spinboxes in the Anki Preferences dialog. Note: Removal of the original unit labels may have altered the UI a little bit.

* Assign buddy widgets in the ID and password retrieval dialog

Set buddy widgets of the labels in the Get ID and password for synchronization dialog.

* Fix positioning/size of text boxes

* Style the suffixes of Preferences' QSpinBoxes

Style QSpinBox suffixes (for those that have one) in the Preferences dialog by prepending them by a space character.
2024-07-10 19:58:47 +07:00
..
browser Fixes shift click selection after programmatic selection in most cases, Issue #2469 (#3213) 2024-06-01 08:54:44 +01:00
data Switch to SvelteKit (#3077) 2024-03-31 09:16:31 +01:00
forms A11Y: Improve the accessibility of the Preferences dialog (#3255) 2024-07-10 19:58:47 +07:00
import_export Fix Mnemosyne importer clobbering source file 2024-05-17 12:34:01 +07:00
operations Display deck names when deleting (#3058) 2024-03-13 12:29:06 +07:00
qt Automatically disable sandbox on Qt5 PyPi/packaged builds 2023-11-16 10:28:58 +10:00
__init__.py Fix auto sync not working on Windows shutdown (#3153) 2024-04-23 00:32:00 +10:00
_macos_helper.py Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
about.py Add Margins on the Buttons on the About Page (#3137) 2024-04-12 05:21:26 +01:00
addcards.py Make a deep copy in reviewer/create-copy (#3013) 2024-02-18 13:09:53 +07:00
addons.py Adjust HTML editor / add-on config editor font (#3054) 2024-03-05 07:29:05 +00:00
changenotetype.py Switch to SvelteKit (#3077) 2024-03-31 09:16:31 +01:00
clayout.py Use Card %d for Cloze and IO template names (#3049) 2024-03-06 08:03:31 +00:00
colors.py Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
customstudy.py Bump Python deps 2024-07-06 18:40:37 +07:00
dbcheck.py Ensure DB check tooltip appears in main window 2024-04-30 23:21:41 +10:00
debug_console.py Pass dict for locals and globals to exec() (#2590) 2023-07-25 21:21:06 +10:00
deckbrowser.py Bump Python deps 2024-07-06 18:40:37 +07:00
deckchooser.py Work around RuntimeError in _update_button_label() (#3224) 2024-06-06 11:19:33 +01:00
deckconf.py Drop support for checkpoints (#2742) 2023-10-17 12:43:34 +10:00
deckdescription.py Update Python deps 2023-03-31 14:04:05 +10:00
deckoptions.py Restore $deckOptions (#3265) 2024-06-28 19:38:18 +07:00
editcurrent.py Apply same ctrl+numpad enter fix that the add screen has 2023-10-26 11:57:37 +10:00
editor.py Revert "Revert "Revert "Preserve HTML formatting inside clozes (#3038)""" 2024-05-17 11:51:09 +07:00
emptycards.py Rework & unify webview identification and title setting (#2366) 2023-02-10 14:53:11 +10:00
errors.py Catch another invalid-timestamp error 2023-12-11 12:39:20 +10:00
exporting.py Change export notes' parent window in card browser (#2761) 2023-10-22 10:23:58 +10:00
fields.py Bump Python deps 2024-07-06 18:40:37 +07:00
filtered_deck.py Use seconds instead of minutes for preview delay 2023-12-21 11:02:29 +10:00
flags.py Introduce new color palette using Sass maps (#2016) 2022-09-16 14:11:18 +10:00
gui_hooks.py Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
importing.py Drop support for checkpoints (#2742) 2023-10-17 12:43:34 +10:00
legacy.py Import submodules directly (#1662) 2022-02-13 13:40:47 +10:00
log.py Add support for python logging (#2969) 2024-02-11 16:41:50 +10:00
main.py Call profile_did_open hook at the end of loadProfile (#3202) 2024-05-24 09:23:29 +01:00
mediacheck.py Add View Files button to Check Media screen (#3006) 2024-02-12 16:17:47 +10:00
mediasrv.py Fix IO rendering in the previewer and template editor (#3228) 2024-06-08 13:18:58 +01:00
mediasync.py Do not show media auto sync errors (#3197) 2024-05-17 06:25:10 +01:00
modelchooser.py Add callback and non-blocking option to StudyDeck (#1643) 2022-02-07 22:05:59 +10:00
models.py fix: refresh model list when legacy addon adds notetype (#2825) 2023-11-13 10:36:21 +10:00
mpv.py Fix mpv loadfile syntax change (#3105) 2024-03-31 07:46:59 +01:00
notetypechooser.py Make dialogs non-blocking (#1650) 2022-02-10 09:53:13 +10:00
overview.py Switch to SvelteKit (#3077) 2024-03-31 09:16:31 +01:00
package.py Fix startup failure in macOS bundle 2023-10-14 13:49:33 +10:00
preferences.py A11Y: Improve the accessibility of the Preferences dialog (#3255) 2024-07-10 19:58:47 +07:00
profiles.py Do not show media auto sync errors (#3197) 2024-05-17 06:25:10 +01:00
progress.py Ignore errors in do_window_cleanup to fix shutdown issue (#3142) 2024-04-17 20:50:41 +10:00
props.py Move away from Bazel (#2202) 2022-11-27 15:24:20 +10:00
py.typed mark anki and aqt modules as having typing info 2020-01-13 13:03:37 +10:00
reviewer.py Feature Show Reminder before answer (#3064) (#3119) 2024-04-13 08:39:50 +01:00
schema_change_tracker.py Add ability to restore a notetype to its original configuration (#2472) 2023-04-18 14:07:51 +10:00
sound.py Pass -- to mpv/mplayer before filename (#3219) 2024-06-01 09:44:24 +01:00
stats.py Switch to SvelteKit (#3077) 2024-03-31 09:16:31 +01:00
studydeck.py Fix filter area not starting focused on Qt 6.6.1 2023-12-06 14:30:46 +10:00
stylesheets.py Workaround Ubuntu ignoring tooltip palette in dark mode 2023-05-31 15:19:10 +10:00
switch.py Dependency updates (#3040) 2024-02-28 16:28:04 +07:00
sync.py A11Y: Improve the accessibility of the Preferences dialog (#3255) 2024-07-10 19:58:47 +07:00
tagedit.py switch to new-style PyQt scoped enums and Qt6 2021-10-15 12:57:19 +10:00
taglimit.py Move custom study tag and limit gathering+saving into the backend 2022-03-10 16:23:03 +10:00
taskman.py Fix mpv idle notification not using main thread 2023-12-06 11:40:05 +10:00
theme.py Fix misalignment of IO masks in Qt5 when image is vertically long (#2829) 2023-11-16 10:30:54 +10:00
toolbar.py Possible workaround for toolbar height issue 2024-03-28 15:37:49 +07:00
tts.py Fix TTS not working properly with auto advance (#2874) 2023-12-06 11:45:33 +10:00
undo.py Dependency updates (#3040) 2024-02-28 16:28:04 +07:00
update.py Fix update suppression 2024-01-09 14:12:26 +10:00
utils.py Revert "Use SplashScreen flag for all aqt tooltips (#3194)" 2024-05-22 17:06:37 +07:00
webview.py Fix IO rendering in the previewer and template editor (#3228) 2024-06-08 13:18:58 +01:00
widgetgallery.py Improve debug console (#2435) 2023-03-15 15:29:05 +10:00
winpaths.py run pyupgrade over codebase [python upgrade required] 2021-10-04 15:05:48 +10:00