Scale text by font size ratio when applying system theme
This commit is contained in:
@@ -147,6 +147,15 @@ match native_theme_gpui::SystemTheme::from_system() {
|
||||
configs, so the subsequent `Theme::change` / `sync_system_appearance` for the
|
||||
user's `AppearanceMode` picks the right native palette.
|
||||
|
||||
Sizing note: gpui-component derives the window rem from `theme.font_size`, so
|
||||
every rem-relative element scales with it. The OS-reported UI font (13 on
|
||||
macOS) is smaller than the 16 this app is designed around, so the native path
|
||||
multiplies `system.accessibility.text_scaling_factor` by
|
||||
`settings.theme.font_size / native_size` before applying — the connector's
|
||||
supported scaling knob, which also preserves any OS accessibility scaling.
|
||||
The same factor scales `mono_font_size`, so code text follows the UI size
|
||||
(the pre-migration app used 13 for mono while the UI was 16).
|
||||
|
||||
On the native path, do **not** set `radius` / `font_size` / `light_theme` /
|
||||
`dark_theme` etc. on `Theme::global_mut` — the connector owns those fields,
|
||||
and overwriting them fights its observer.
|
||||
|
||||
Reference in New Issue
Block a user