matatk / agrip

AGRIP AudioQuake and Level Description Language (LDL)
http://agrip.org.uk
Other
16 stars 6 forks source link

fix: Improve the accessible names of controls throughout the launcher #73

Closed matatk closed 3 years ago

matatk commented 3 years ago

Associate labels with controls

This was much harder than thought, but thanks to the NVDA source giving a good example, this is working well now on Windows. Sadly it isn't so much on macOS Catalina with VoiceOver, but it is workable.

This replaces the FilePickerCtrl with a FileDialog so that the button can be made custom, and uses the NVDA technique of grouping related controls in a horizontal BoxSizer to associate the label with the chosen map file's textbox. Layout is improved and add_widget() is simplified as a result, too.

This also uses another NVDA technique to put the textbox (actually an ExpandoTextCtrl) in the focus order.

Thanks to https://github.com/nvaccess/nvda/blob/55a9b32e4d3889c04a1ea4ad5834a59d8851e009/source/gui/guiHelper.py#L111 :-)

General labelling improvements

Use StaticBoxSizers on Windows to improve organisation and naming. This groups related controls like a

in HTML terms. However the focus order with VoiceOver on macOS (Catalina and Big Sur) goes wrong when doing this, so provide a fallback on macOS to a normal sizer with some StaticText at the start.

Minor code tweaks

  • Use a property for the chosen map path.
  • Clearer names in the code for the UI tabs (particularly map).