Skip to content

feat(app): zoom the desktop app's text and controls from Settings - #643

Merged
linroid merged 1 commit into
mainfrom
feat/ui-zoom
Oct 24, 2026
Merged

linroid merged 1 commit into
mainfrom
feat/ui-zoom

Conversation

@linroid

@linroid linroid commented Oct 24, 2026

Copy link
Copy Markdown
Owner

Fixes #600: the desktop UI's text is too small on high-resolution displays, and the tray menu's text doesn't match the app's.

What changes

  • Settings → General → Zoom offers 90 %, 100 %, 110 %, 125 %, 150 %, 175 % and 200 %. The choice is saved as [appearance] zoom (a percentage).
    • Changes apply at once to every Ketch window: the main window, the Settings window and the close dialog.
    • Settings search finds it by words like "zoom", "text size" or "font size".
  • How it works: KetchTheme(zoom) multiplies LocalDensity. Text, icons, spacing, controls, menus and tooltips all grow together, and layouts choose their tier from the zoomed width. Window sizes stay as they are.
    • Changing the zoom keeps the content's state, because the density provider is always present.
    • WindowChrome.zoomed keeps the macOS traffic lights clear at any zoom.
  • Reading the config: zoom loads leniently.
    • Values outside 50–300 load as the nearest bound.
    • Anything that isn't a whole number loads as 100, so a hand edit can never make config.toml unreadable.
  • Tray menu: its text follows the zoom.
    • At 100 % it is now 12 px, the size Windows uses for its own menus; Java's default was 11 px.
    • The font family can't change on Windows. Java draws AWT menus there itself and only maps its logical fonts: WFontConfiguration falls back to sansserif for any other name. On Chinese Windows that means Arial plus SimSun, which is why the menu looked different.
    • A menu matching the app's own font would need a Compose-drawn tray menu, which is left as a follow-up.
  • Where it's offered: only on desktop (zoomSupported). Phones follow the system's display and text size, and browsers zoom the web app themselves.
  • Translations: strings are added in all ten languages.

Snapshots

Before After
before after
Zoom 100 % Zoom 150 %
100 150

Tests

  • AppearanceConfigTest: round trip, clamping, unreadable values. Passed on JVM and the iOS simulator.
  • AppSettingsControllerTest: saveZoom clamps and keeps the rest of [appearance].
  • WindowChromeTest: the title-bar spacing at zoom 2 and 0.5.
  • KetchThemeZoomTest: a render test showing that zoom scales the content and keeps its state.
  • TrayMenuFontTest: the tray font size at each zoom.
  • SettingsSearchRenderTest: the new search entry names a row that is on the General page.
  • Whole suites: :app:shared:jvmTest (2,446 tests) and :app:desktop:test both pass. :app:shared compiles for wasmJs, iOS and Android.
  • ZoomSnapshots renders the app at 100 % and 150 %.

Not verified: the tray menu on a real Windows machine. The change there only sets the AWT PopupMenu font.

Settings → General → Zoom (90 % to 200 %, saved as [appearance] zoom) draws every
Ketch window larger or smaller: KetchTheme multiplies the density, so text, icons,
spacing and controls grow together and layouts pick their tier from the zoomed
width. The macOS title bar keeps the traffic lights clear at any zoom.

The tray menu, which Java draws itself on Windows and Linux, follows the zoom
too, starting from the 12 px Windows uses for its own menus rather than Java's
11 px. Java's menus on Windows only take its own fonts, so its family stays
Java's sans-serif.

Phones follow the system's display and text size and browsers zoom the web app,
so only the desktop app offers it.

Fixes #600
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-24T02:52:43.076719Z
We couldn’t complete this review. Comment @codex review to try again.
bbf40c1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

Copy link
Copy Markdown
Contributor

Test Results

 2 213 files  + 5   2 241 suites  +5   58m 39s ⏱️ +38s
15 449 tests +19  15 180 ✅ +18  269 💤 +1  0 ❌ ±0 
18 816 runs  +19  18 547 ✅ +18  269 💤 +1  0 ❌ ±0 

Results for commit bbf40c1. ± Comparison against base commit 18d1de8.

@linroid
linroid merged commit 6662002 into main Oct 24, 2026
15 checks passed
@linroid
linroid deleted the feat/ui-zoom branch October 24, 2026 06:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

可以优化一下界面的字体吗?

1 participant