Repository navigation
feat(ui): the interface scale is a zoom of the whole UI, smooth and without overflow - #1811
Merged
Merged
Conversation
…lways fits; it applies at once and animates (zoom)
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.
Zoom for the interface scale (Preferences → Appearance → Interface scale).
Before. The scale multiplied the text scaler and was applied by hand (
context.scaled) in 20 of 540 files: text grew, icons, paddings and fixed heights did not, so screens overflowed at high scales in small windows. A CI probe (PR #1810) counted RenderFlex overflows of the shell, Preferences, the PostgreSQL form and the palette: none up to 1.25, but at 2.0 in 1280x720 (form, 520 px), 1.5 in 900x600 (form) and 2.0 in 900x600 (shell, Preferences, form). The change also waited for the database write before the UI moved.Now.
QueryaUiZoom(lib/core/layout/ui_zoom.dart) at the app root: the child is laid out in a windowscaletimes smaller and paintedscaletimes larger, so text, icons, paddings and hit areas grow together; dialogs, menus and tooltips (the Navigator below) zoom with it.MediaQuerysize and insets are divided by the zoom; the text scaler is no longer multiplied.effectiveUiScalenever zooms the layout belowkMinUiLayoutSize(900x600, the minimum window), so a big scale in a small window is lowered instead of overflowing (1280x720 allows 120%).UiScaleController.commitScaleapplies the new value and notifies first, then stores it; a failed write is logged and no longer undoes the choice.context.windowToApp; they were the only places that placed something at a rawevent.position.QueryaUiScaleScopestays (tests andcontext.scaleduse it) but is 1.0 in the app now; thescaledcall sites can go in a cleanup.Tests.
ui_zoom_test(cap, layout size, paint size, a tap hits the widget under the pointer, windowToApp, animation), andui_scale_overflow_testruns the realQueryaAppat scales 0.75 to 2.0 in 1280x720 and 900x600 and fails on any overflow (the numbers above are its baseline). Not run locally (analyzer clean), CI will; please look at the zoom once by eye, at 75%, 150% and 200%, in a small window too.