Skip to content

Commit

Permalink
Elements List dialog: Remove the accelerator key on the "Activate" bu…
Browse files Browse the repository at this point in the history
…tton (#6167) (#12369)

Fixes #6167

Summary of the issue:
In the English locale, there is an accelerator key collision between the "Annotation" element type and the "Activate" button, both set to the letter "A".
In the French locale, there is collision between the element type "Form field" ("Champs de formulaire") and the same button ("Activer"), both set to the letter "C".
This changes the behavior of the accelerator key that focuses the radio button but does not activate it.
This is not a bug at all, but is not ergonomically optimum, especially for less advanced users.

Description of how this pull request fixes the issue:
As suggested by @Qchristensen, remove the accelerator key setting from the "Activate" button as it is, when available, the default action of the dialog upon pressing the enter key.
In most locale, this change should not raise the need for a new translation, as the "Activate" label already exists without an accelerator marker as "a message reported when the action at the position of the review cursor or navigator object is performed.".
Just to be sure, I also added a warning in the translators comment for the button label to ask them to beware of the risk of collision.
  • Loading branch information
JulienCochuyt authored May 9, 2021
1 parent ef53fb5 commit e2c206d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/browseMode.py
Original file line number Diff line number Diff line change
Expand Up @@ -972,9 +972,10 @@ def __init__(self, document):
contentsSizer.AddSpacer(gui.guiHelper.SPACE_BETWEEN_VERTICAL_DIALOG_ITEMS)

bHelper = gui.guiHelper.ButtonHelper(wx.HORIZONTAL)
# Translators: The label of a button to activate an element
# in the browse mode Elements List dialog.
self.activateButton = bHelper.addButton(self, label=_("&Activate"))
# Translators: The label of a button to activate an element in the browse mode Elements List dialog.
# Beware not to set an accelerator that would collide with other controls in this dialog, such as an
# element type radio label.
self.activateButton = bHelper.addButton(self, label=_("Activate"))
self.activateButton.Bind(wx.EVT_BUTTON, lambda evt: self.onAction(True))

# Translators: The label of a button to move to an element
Expand Down

0 comments on commit e2c206d

Please sign in to comment.