Simulate->Larger Text: refresh the simulator instantly (#4963)#4964
Merged
Conversation
The menu action rebuilt the UIManager theme but never pushed the new styles into the live form, so components kept their pre-refresh Style references and the user saw no change until restart. The scale itself also compounded across refreshes because applyLargerTextScaleToThemeFonts derived from the already-scaled Font in themeProps -- XL->XXL over-scaled and going back to default never shrank fonts. JavaSEPort.refreshThemeOnly now calls Form.refreshTheme(true) so the component tree picks up the rebuilt styles. UIManager tracks the original/derived Font pair it wrote and rolls back before each scale pass, so every refresh derives from the unscaled installed font. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Collaborator
Author
|
Compared 7 screenshots: 7 matched. |
Contributor
✅ Continuous Quality ReportTest & Coverage
Static Analysis
Generated automatically by the PR CI workflow. |
Collaborator
Author
|
Compared 107 screenshots: 107 matched. Native Android coverage
✅ Native Android screenshot tests passed. Native Android coverage
Benchmark ResultsDetailed Performance Metrics
|
Collaborator
Author
|
Compared 107 screenshots: 107 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
Collaborator
Author
|
Compared 105 screenshots: 105 matched. Benchmark Results
Build and Run Timing
Detailed Performance Metrics
|
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.
Summary
JavaSEPort.refreshThemeOnlynow also callsForm.refreshTheme(true)so components on screen pick up the rebuilt styles. Without this stepUIManager.refreshTheme()only rebuilt the theme cache; the form kept its pre-refresh Style refs and the user saw no change until restart.UIManager.applyLargerTextScaleToThemeFontstracks the original/derived Font pair it wrote and rolls back before each pass, so every scale change derives from the unscaled installed font instead of compounding on the previously-scaled one (XL -> XXL no longer over-scales; going back to Large actually shrinks).applyThemeOnlyRefresh(Form)as a package-private seam so the menu action and the regression tests share the exact same sequence.Fixes #4963.
Test plan
mvn test -Plocal-dev-javaseinmaven/core-unittests-- newtestRepeatedScaleChangesDoNotCompoundwalks scale 1.0 -> 1.5 -> 2.0 -> 1.25 -> 1.0 and asserts the pixel size matches each step.mvn test -Plocal-dev-javase-- newtestFormRefreshThemePropagatesScaleChangeadds a Label to a Form, resolves its style, then assertslabel.getStyle().getFont().getPixelSize()tracks the scale across full up-and-back-down cycle.maven/javasetests (20 tests) still pass.Generated with Claude Code