Skip to content

GUI: Standard dialog separated dismiss buttons and borders (#6468)#10159

Merged
feerrenrut merged 17 commits into
nvaccess:masterfrom
accessolutions:i6468-separatedDialogDismissButtons
Jul 2, 2020
Merged

GUI: Standard dialog separated dismiss buttons and borders (#6468)#10159
feerrenrut merged 17 commits into
nvaccess:masterfrom
accessolutions:i6468-separatedDialogDismissButtons

Conversation

@JulienCochuyt

Copy link
Copy Markdown
Contributor

Link to issue number:

Fixes #6468

Summary of the issue:

Several dialogs in NVDA lack to visually present dismiss buttons with standardized separator and borders.

Description of how this pull request fixes the issue:

  • Add a new keyword argument "separated" in gui.guiHelper.BoxSizerHelper.addDialogDismissButtons for use by cases other than message / single input dialogs.
  • Impact the following dialogs:
    • Configuration Profiles
    • Configuration Profile Creation
    • Configuration Profile Triggers
    • Add-ons
    • Incompatible Add-ons
    • Portable Copy Creation
    • Settings
    • Synthesizer Selection
    • Braille Device Selection
    • Dictionary Entries
    • Dictionary Entry Edition
    • Punctuation/symbol pronunciation

Testing performed:

Accessed all the above-mentioned dialogs to check their proper look and behavior.

Known issues with pull request:

Change log entry:

Section: Changes for developers

The GUI Helper's BoxSizerHelper.addDialogDismissButtons supports a new "separated" keyword argument, for add a standard horizontal separator on dialogs other than messages and single inputs.

@AppVeyorBot

Copy link
Copy Markdown

PR introduces Flake8 errors 😲

See test results for Failed build of commit 2c4c0d850e

@josephsl

josephsl commented Aug 31, 2019 via email

Copy link
Copy Markdown
Contributor

@JulienCochuyt JulienCochuyt force-pushed the i6468-separatedDialogDismissButtons branch from b1f0a11 to 7f5ec02 Compare August 31, 2019 19:43
@Brian1Gaff

Brian1Gaff commented Sep 1, 2019 via email

Copy link
Copy Markdown

@JulienCochuyt

Copy link
Copy Markdown
Contributor Author

Are dismiss buttons really a standard? Many go away using Escape.

By "standard" I mean "typical Windows look and feel as tailored by tools from Microsoft and exhibited by their software".
In this way, yes, dismiss buttons are pretty standard among window managers.
wxWidgets mentions phones with physical keys as the only exception in the many different platform they cover.

By the way, adopting a standard look and feel is not only for aesthetics: It helps users with low vision to easily rely on common patterns and visual cues.

@nishimotz

Copy link
Copy Markdown
Contributor

tested nvda_snapshot_pr10159-18482,8a96fb7c.exe and confirmed it works as expected regarding visual separators.

@JulienCochuyt

Copy link
Copy Markdown
Contributor Author

cc @feerrenrut

buttonSizer.addButton(self, label=_("OK"), id=wx.ID_OK)
# Translators: The cancel button on a NVDA dialog. This button will discard any changes and dismiss the dialog.
buttonSizer.addButton(self, label=_("Cancel"), id=wx.ID_CANCEL)
buttons = wx.OK | wx.CANCEL

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The downside with this approach (providing ID's for the buttons) is that we don't get to control the translations for these buttons. I believe there are languages where these buttons will not be translated. If we provide the label, we are able to have them translated.

We have a mixture of sources for these buttons (created via ID or created with a translated label).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are definitely right about translation here.
I took the ID approach because of the current mixture you mention.
Actually, every single time we use a standard message box with Yes/No/Apply/OK/Cancel or even the standard file picker or folder picker, these currently appear in the language of the OS, not the language of NVDA.
It is pretty common practice, and I guess native speakers of languages in which Windows itself is not translated are quite used to this.
To fully circumvent this situation, we would have to:

  • Re-implement every single standard message box we emit. A lot of work, but doable.
  • Step back from taking advantage of the wx.Dialog.CreateSeparatedButtonSizer facility.
  • Implement custom file and folder pickers. This one is much more tricky if you want - and should - provide the appropriate look and feel for every single version of Windows NVDA supports.

Thus, IMHO, the easiest and safest path is to use IDs instead of custom translations everywhere applicable, be it only to ensure coherence among the different part of the GUI.

Comment thread source/gui/guiHelper.py
elif isinstance(buttons, (wx.Sizer, wx.Button)):
toAdd = buttons
elif isinstance(buttons, int):
toAdd = self._parent.CreateButtonSizer(buttons)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per my other comment about translations of the button labels, perhaps it would be better to construct the buttons with our own translated labels here?

@JulienCochuyt

Copy link
Copy Markdown
Contributor Author

Merged latest master and aligned PR #10076 to follow the same paradigm.
@feerrenrut, did you have time to consider #10159 (comment) regarding IDs and translations? What do you think?

@feerrenrut

Copy link
Copy Markdown
Contributor

I think for now, it would be best to leave the translated button labels, since it is not necessary for achieving the main goal of this PR. I understand that there is a mix of translated and not buttons at the moment, but what to do about that is a decision on its own. Working out a strategy for getting a uniform approach to button translation can be done in another PR. One question to answer on a new PR is if there is a way to make WX use use a specified locale rather than the OS one.

@feerrenrut feerrenrut added the ux label Apr 8, 2020

@feerrenrut feerrenrut left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall I'm not too sure about the look for dialogs like the settings dialog. When there is already a groupbox outline or a panel outline the extra horizontal line makes it look busy. I'll accept and merge this change for now, since I don't think it is a big harm, but we may wish to re-visit those dialogs specifically.

@feerrenrut feerrenrut merged commit a646fcd into nvaccess:master Jul 2, 2020
@nvaccessAuto nvaccessAuto added this to the 2020.3 milestone Jul 2, 2020
@JulienCochuyt JulienCochuyt deleted the i6468-separatedDialogDismissButtons branch July 2, 2020 14:19
feerrenrut added a commit that referenced this pull request Jul 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

7 participants