Skip to content

Commit

Permalink
Attempt to cover more cases
Browse files Browse the repository at this point in the history
  • Loading branch information
AAClause committed May 12, 2024
1 parent e7b18c5 commit ea91092
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
9 changes: 6 additions & 3 deletions addon/globalPlugins/brailleExtender/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,12 @@ def event_valueChange(self, obj, nextHandler):

def event_nameChange(self, obj, nextHandler):
if config.conf["brailleExtender"]["advanced"]["refreshForegroundObjNameChange"]:
obj = api.getForegroundObject()
braille.handler.handleUpdate(obj)
vision.handler.handleUpdate(obj, property="name")
fg = api.getForegroundObject()
visibleRegions = list(braille.handler.mainBuffer.visibleRegions)
if len(visibleRegions) > 1 and visibleRegions[0].obj is not api.getFocusObject() and visibleRegions[0].obj is not fg:
visibleRegions[0].obj = fg
braille.handler.handleUpdate(fg)
vision.handler.handleUpdate(fg, property="name")
nextHandler()

def createMenu(self):
Expand Down
2 changes: 1 addition & 1 deletion addon/globalPlugins/brailleExtender/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ class AdvancedDlg(gui.settingsDialogs.SettingsPanel):

def makeSettings(self, settingsSizer):
sHelper = gui.guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
self.refreshForegroundObjNameChange = sHelper.addItem(wx.CheckBox(self, label="event_nameChange: " + _("refresh braille region related to &foreground object")))
self.refreshForegroundObjNameChange = sHelper.addItem(wx.CheckBox(self, label="event_nameChange: " + _("force the refresh of braille region related to &foreground object")))
self.refreshForegroundObjNameChange.SetValue(config.conf["brailleExtender"]["advanced"]["refreshForegroundObjNameChange"])

def onSave(self):
Expand Down

0 comments on commit ea91092

Please sign in to comment.