Skip to content

Commit

Permalink
Change input help documentation for move to first/last row scripts of…
Browse files Browse the repository at this point in the history
… fake table navigation in list views. (#13788)

Follow-up of #13435.

Summary of the issue:
In fake table navigation in list views, horizontal movements only move the navigator object, whereas vertical movements move the navigator object but also the focus. This was not reflected in input help for the newly introduced commands to jump to first/last row.

Description of how this pull request fixes the issue:
Updated the two scripts documentation.
While at it, I have also converted remaining fake table navigation scripts to syntax with decorator.
  • Loading branch information
CyrilleB79 authored Jun 13, 2022
1 parent b6fef4d commit 424afaf
Showing 1 changed file with 26 additions and 20 deletions.
46 changes: 26 additions & 20 deletions source/NVDAObjects/behaviors.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,12 @@ def _moveToColumnNumber(self, column):
cell = self.getChild(child)
self._moveToColumn(cell)

@script(
# Translators: The description of an NVDA command.
description=_("Moves the navigator object to the next column"),
gesture="kb:control+alt+rightArrow",
canPropagate=True,
)
def script_moveToNextColumn(self, gesture):
cur = api.getNavigatorObject()
if cur == self:
Expand All @@ -613,10 +619,13 @@ def script_moveToNextColumn(self, gesture):
while new and new.location and new.location.width == 0:
new = new.next
self._moveToColumn(new)
script_moveToNextColumn.canPropagate = True
# Translators: The description of an NVDA command.
script_moveToNextColumn.__doc__ = _("Moves the navigator object to the next column")

@script(
# Translators: The description of an NVDA command.
description=_("Moves the navigator object to the previous column"),
gesture="kb:control+alt+leftArrow",
canPropagate=True,
)
def script_moveToPreviousColumn(self, gesture):
cur = api.getNavigatorObject()
if cur == self:
Expand All @@ -628,9 +637,6 @@ def script_moveToPreviousColumn(self, gesture):
while new and new.location and new.location.width == 0:
new = new.previous
self._moveToColumn(new)
script_moveToPreviousColumn.canPropagate = True
# Translators: The description of an NVDA command.
script_moveToPreviousColumn.__doc__ = _("Moves the navigator object to the previous column")

def reportFocus(self):
col = self._savedColumnNumber
Expand All @@ -647,17 +653,23 @@ def _moveToRow(self, row):
self.__class__._savedColumnNumber = nav.columnNumber
row.setFocus()

@script(
# Translators: The description of an NVDA command.
description=_("Moves the navigator object and focus to the next row"),
gesture="kb:control+alt+downArrow",
canPropagate=True,
)
def script_moveToNextRow(self, gesture):
self._moveToRow(self.next)
script_moveToNextRow.canPropagate = True
# Translators: The description of an NVDA command.
script_moveToNextRow.__doc__ = _("Moves the navigator object and focus to the next row")

@script(
# Translators: The description of an NVDA command.
description=_("Moves the navigator object and focus to the previous row"),
gesture="kb:control+alt+upArrow",
canPropagate=True,
)
def script_moveToPreviousRow(self, gesture):
self._moveToRow(self.previous)
script_moveToPreviousRow.canPropagate = True
# Translators: The description of an NVDA command.
script_moveToPreviousRow.__doc__ = _("Moves the navigator object and focus to the previous row")

@script(
description=_(
Expand Down Expand Up @@ -693,7 +705,7 @@ def script_moveToLastColumn(self, gesture):
@script(
description=_(
# Translators: The description of an NVDA command.
"Moves the navigator object to the first row"
"Moves the navigator object and focus to the first row"
),
gesture="kb:Control+Alt+PageUp",
canPropagate=True,
Expand All @@ -704,20 +716,14 @@ def script_moveToFirstRow(self, gesture):
@script(
description=_(
# Translators: The description of an NVDA command.
"Moves the navigator object to the last row"
"Moves the navigator object and focus to the last row"
),
gesture="kb:Control+Alt+PageDown",
canPropagate=True,
)
def script_moveToLastRow(self, gesture):
self._moveToRow(self.parent.lastChild)

__gestures = {
"kb:control+alt+rightArrow": "moveToNextColumn",
"kb:control+alt+leftArrow": "moveToPreviousColumn",
"kb:control+alt+downArrow": "moveToNextRow",
"kb:control+alt+upArrow": "moveToPreviousRow",
}

class RowWithoutCellObjects(NVDAObject):
"""An abstract class which creates cell objects for table rows which don't natively expose them.
Expand Down

0 comments on commit 424afaf

Please sign in to comment.