Draft
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aims to persist NVDA’s Magnifier enabled/disabled state in configuration, expose an “Enable magnifier” checkbox in the Magnifier settings panel (with immediate effect), and adjust some dialog accelerator keys to avoid conflicts.
Changes:
- Add
magnifier.enabledto the config spec and implementgetEnabled/setEnabledhelpers. - Update magnifier toggle command to persist enabled state.
- Add an “Enable magnifier (immediate effect)” checkbox to the Magnifier settings panel and update User Guide documentation.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| user_docs/en/userGuide.md | Documents new Magnifier enable setting in the User Guide. |
| source/gui/settingsDialogs.py | Adds enable/disable checkbox to the Magnifier settings panel and adjusts accelerator keys. |
| source/config/configSpec.py | Introduces persisted magnifier.enabled setting. |
| source/_magnifier/config.py | Adds config accessors for magnifier enabled state. |
| source/_magnifier/commands.py | Persists enabled state when toggling magnifier. |
|
|
||
| # Magnifier settings | ||
| [magnifier] | ||
| enabled = boolean(default=false) |
Comment on lines
+18
to
+20
| Set the config for the magnifier state (enable or disabled). | ||
|
|
||
| :param enabled: True if the magnifier is enabled, False if it is disabled. |
Comment on lines
80
to
122
| def toggleMagnifier() -> None: | ||
| """Toggle the NVDA magnifier on/off""" | ||
| import screenCurtain | ||
|
|
||
| magnifier: Magnifier = getMagnifier() | ||
| if magnifier and magnifier._isActive: | ||
| # Stop magnifier | ||
| terminate() | ||
| ui.message( | ||
| pgettext( | ||
| "magnifier", | ||
| # Translators: Message announced when stopping the NVDA magnifier. | ||
| "Exiting magnifier", | ||
| ), | ||
| ) | ||
| # Check if Screen Curtain is active | ||
| elif screenCurtain.screenCurtain and screenCurtain.screenCurtain.enabled: | ||
| ui.message( | ||
| pgettext( | ||
| "magnifier", | ||
| # Translators: Message announced when trying to start magnifier while Screen Curtain is active. | ||
| "Cannot start magnifier: Screen Curtain is active. Please disable Screen Curtain first.", | ||
| ), | ||
| ) | ||
| return | ||
| else: | ||
| initialize() | ||
|
|
||
| filter = getFilter() | ||
| fullscreenMode = getFullscreenMode() | ||
|
|
||
| ui.message( | ||
| pgettext( | ||
| "magnifier", | ||
| # Translators: Message announced when starting the NVDA magnifier. | ||
| "Starting magnifier with {zoomLevel} zoom level, {filter} filter, and {fullscreenMode} full-screen mode", | ||
| ).format( | ||
| zoomLevel=getZoomLevelString(), | ||
| filter=filter.displayString, | ||
| fullscreenMode=fullscreenMode.displayString, | ||
| ), | ||
| ) | ||
| setEnabled(isActive()) | ||
|
|
| The Magnifier category in the NVDA Settings dialog allows you to configure the default behavior of NVDA's built-in [Magnifier](#Magnifier) feature. | ||
| This settings category contains the following options: | ||
|
|
||
| ##### Enable Magnfier {#MagnifierEnable} |
|
|
||
| ##### Enable Magnfier {#MagnifierEnable} | ||
|
|
||
| Enables the magnifier. |
| config.conf["magnifier"]["keepMouseCentered"] = self.keepMouseCenteredCheckBox.GetValue() | ||
|
|
||
| def onEnableMagnifierChange(self, evt: wx.CommandEvent): | ||
| toggleMagnifier() |
| fullscreenMode=fullscreenMode.displayString, | ||
| ), | ||
| ) | ||
| setEnabled(isActive()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Fixes #19494
Summary of the issue:
Whether or not the magnifier has already started was not persisted in config
Description of user facing changes:
magnifier being enabled is now persisted in config
fixed some collisions with accelerator keys in the magnifier settings dialog
Description of developer facing changes:
none
Description of development approach:
added code to toggle magnifier and persist in settings
Testing strategy:
manual testing
Known issues with pull request:
none
Code Review Checklist: