Repository navigation
feat(settings): grow text and controls with the window (界面大小) - #104
Merged
Merged
Conversation
A maximized window on a large screen kept the default text and control size. 设置 › 通用 now has 界面大小: 自动 (the default) zooms the window with its size, from 100 % at the default 1600×1000 window up to 150 %; fixed sizes from 100 % to 150 % are offered too. Neither lets the page fall below its 1024×640 layout. Main applies the zoom factor on every resize and moves the native title bar parts into the zoomed bar.
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.
What and why
Issue #10: enlarging the window did not make text or the UI any larger, so a maximized window on a large screen showed small text.
设置 › 通用gets 界面大小: 自动 (default), 100%, 110%, 125% or 150%. It is applied as the window's zoom factor (shared/uiScale.ts,uiZoomFactor):main/windows.ts) applies it on every resize, after page load, and when the setting changes. It also moves the native title bar parts to the zoomed 40 px bar: the Windows overlay height and the macOS traffic lights.How it was verified
pnpm lint(0 errors; the warnings were already there),pnpm format:check,pnpm typecheck,pnpm test:unit: 3836 passed, including the newtest/shared/uiScale.test.ts(default window at 100%, growth and the 150% cap, the shorter side deciding, never below 100% or the minimum layout, 5% steps).pnpm build && pnpm test:e2e: 449 passed. New insettings.e2e.ts: 界面大小 starts on 自动, and picking 125% saves{ uiScale: '125' }.innerWidth1600, so the layout is the default one, drawn 50% larger. Back at 1600 × 1000 it was 1 again.pnpm test:install: not applicable.docs/reference/architecture.md(window section) anddocs/how-to/setup.md(设置 › 通用).Platforms affected
Notes for the reviewer
Only the zoom computation and the setting were tested automatically, on Linux. The overlay and traffic-light positions on Windows and macOS follow from the same factor, but they were not seen on those systems.