Persist magnifier zoom, filter, full screen mode#20050
Draft
Persist magnifier zoom, filter, full screen mode#20050
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates NVDA's magnifier module so gesture-driven changes are written back to the running configuration, aligning keyboard commands with how magnifier settings are expected to persist across restarts and re-enablement.
Changes:
- Persist zoom level changes by writing from the magnifier zoom setter into config.
- Persist filter changes when cycling filters from commands.
- Persist full-screen mode changes when cycling focus modes from commands.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
source/_magnifier/magnifier.py |
Writes zoom-level updates to config from the shared magnifier setter. |
source/_magnifier/commands.py |
Persists filter and full-screen mode changes triggered by keyboard commands. |
| newMode = modes[(idx + 1) % len(modes)] | ||
| log.debug(f"Changing full-screen mode from {currentMode} to {newMode}") | ||
| magnifier._fullscreenMode = newMode | ||
| setFullscreenMode(newMode) |
| closestZoom = min(validZoomValues, key=lambda x: abs(x - value)) | ||
| log.warning(f"Invalid zoom level {value}, using closest valid value {closestZoom}") | ||
| value = closestZoom | ||
| setZoomLevel(value) |
| magnifier.filterType = filters[(idx + 1) % len(filters)] | ||
| if magnifier._magnifierType == MagnifierType.FULLSCREEN: | ||
| magnifier._applyFilter() | ||
| setFilter(magnifier.filterType) |
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 #19493
Summary of the issue:
Magnifier zoom, filter and full screen mode were not persisted when set via keyboard gestures
Description of user facing changes:
Persist Magnifier zoom, filter and full screen mode in settings
Description of developer facing changes:
none
Description of development approach:
add calls to persist the settings when they are changed
Testing strategy:
manual testing
Known issues with pull request:
none
Code Review Checklist: