Skip to content

Commit 062c99a

Browse files
authored
Merge b0c873a into 3f82ab6
2 parents 3f82ab6 + b0c873a commit 062c99a

5 files changed

Lines changed: 30 additions & 0 deletions

File tree

source/braille.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,9 @@
330330
# used to separate chunks of text when programmatically joined
331331
TEXT_SEPARATOR = " "
332332

333+
# Indicator at the start of paragraphs
334+
PARAGRAPH_START = " "
335+
333336
#: Identifier for a focus context presentation setting that
334337
#: only shows as much as possible focus context information when the context has changed.
335338
CONTEXTPRES_CHANGEDCONTEXT = "changedContext"
@@ -1083,6 +1086,9 @@ def getFormatFieldBraille(field, fieldCache, isAtStart, formatConfig):
10831086
"""
10841087
textList = []
10851088
if isAtStart:
1089+
brailleConfig = config.conf["braille"]
1090+
if brailleConfig["readByParagraph"] and brailleConfig["showParagraphStart"]:
1091+
textList.append(PARAGRAPH_START)
10861092
if formatConfig["reportLineNumber"]:
10871093
lineNumber = field.get("line-number")
10881094
if lineNumber:

source/config/configSpec.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@
8383
reviewRoutingMovesSystemCaret = featureFlag(\
8484
optionsEnum="ReviewRoutingMovesSystemCaretFlag", behaviorOfDefault="NEVER")
8585
readByParagraph = boolean(default=false)
86+
showParagraphStart = featureFlag(optionsEnum="BoolFlag", behaviorOfDefault="disabled")
8687
wordWrap = boolean(default=true)
8788
unicodeNormalization = featureFlag(optionsEnum="BoolFlag", behaviorOfDefault="disabled")
8889
focusContextPresentation = option("changedContext", "fill", "scroll", default="changedContext")

source/gui/settingsDialogs.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4363,8 +4363,22 @@ def makeSettings(self, settingsSizer):
43634363
wx.CheckBox(self.followCursorGroupBox, label=readByParagraphText),
43644364
)
43654365
self.bindHelpEvent("BrailleSettingsReadByParagraph", self.readByParagraphCheckBox)
4366+
self.readByParagraphCheckBox.Bind(wx.EVT_CHECKBOX, self.onReadByParagraphChange)
43664367
self.readByParagraphCheckBox.Value = config.conf["braille"]["readByParagraph"]
43674368

4369+
self.showParagraphStartCombo: nvdaControls.FeatureFlagCombo = followCursorGroupHelper.addLabeledControl(
4370+
labelText=_(
4371+
# Translators: This is a label for a combo-box in the Braille settings panel.
4372+
"Show para&graph start",
4373+
),
4374+
wxCtrlClass=nvdaControls.FeatureFlagCombo,
4375+
keyPath=["braille", "showParagraphStart"],
4376+
conf=config.conf,
4377+
)
4378+
self.bindHelpEvent("BrailleShowParagraphStart", self.showParagraphStartCombo)
4379+
if not self.readByParagraphCheckBox.GetValue():
4380+
self.showParagraphStartCombo.Disable()
4381+
43684382
# Translators: The label for a setting in braille settings to select how the context for the focus object should be presented on a braille display.
43694383
focusContextPresentationLabelText = _("Focus context presentation:")
43704384
self.focusContextPresentationValues = [x[0] for x in braille.focusContextPresentations]
@@ -4459,6 +4473,7 @@ def onSave(self):
44594473
braille.handler.setTether(tetherChoice, auto=False)
44604474
self.brailleReviewRoutingMovesSystemCaretCombo.saveCurrentValueToConf()
44614475
config.conf["braille"]["readByParagraph"] = self.readByParagraphCheckBox.Value
4476+
self.showParagraphStartCombo.saveCurrentValueToConf()
44624477
config.conf["braille"]["wordWrap"] = self.wordWrapCheckBox.Value
44634478
self.unicodeNormalizationCombo.saveCurrentValueToConf()
44644479
config.conf["braille"]["focusContextPresentation"] = self.focusContextPresentationValues[
@@ -4484,6 +4499,9 @@ def onTetherToChange(self, evt: wx.CommandEvent) -> None:
44844499
tetherChoice = [x.value for x in TetherTo][evt.GetSelection()]
44854500
self.brailleReviewRoutingMovesSystemCaretCombo.Enable(tetherChoice != TetherTo.FOCUS.value)
44864501

4502+
def onReadByParagraphChange(self, evt):
4503+
self.showParagraphStartCombo.Enable(evt.IsChecked())
4504+
44874505
def _onModeChange(self, evt: wx.CommandEvent):
44884506
self.followCursorGroupBox.Enable(not evt.GetSelection())
44894507

user_docs/en/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
* Enhanced Microsoft Word comment command: press twice to present comment content in browsable message. (#16800, @Cary-Rowen)
1010
* Enhanced Microsoft Excel notes command: press twice to present notes content in browsable message. (#16878, @Cary-Rowen)
1111
* NVDA can now be configured to report font attributes in speech and braille separately. (#16755)
12+
* NVDA can now be configured to indicate the start of paragraphs in braille when the reading by paragraph option is enabled (#16895, @nvdaes)
1213

1314

1415
### Bug Fixes

user_docs/en/userGuide.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2163,6 +2163,10 @@ This means that you do not have to scroll the display at the end of each line ev
21632163
This may allow for more fluent reading of large amounts of text.
21642164
It is disabled by default.
21652165

2166+
##### Show paragraphs start {#BrailleSettingsShhowParagraphStart}
2167+
2168+
If enabled and read by paragraph is checked, two spaces will be displayed to indicate paragraph start.
2169+
21662170
##### Avoid splitting words when possible {#BrailleSettingsWordWrap}
21672171

21682172
If this is enabled, a word which is too large to fit at the end of the braille display will not be split.

0 commit comments

Comments
 (0)