Add ui_font_size setting (#3199)

This PR adds a new `ui_font_size` setting that can be used to control
the scale of the entire UI.

We use the value in this setting to set the base rem size of the window.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2023-11-01 18:11:12 +01:00 committed by GitHub
parent bd61d71018
commit b910bbf002
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 58 additions and 50 deletions

View file

@ -1,4 +1,4 @@
use gpui2::{relative, Hsla, WindowContext};
use gpui2::{relative, rems, Hsla, WindowContext};
use smallvec::SmallVec;
use crate::prelude::*;
@ -86,7 +86,7 @@ impl Label {
.bg(LabelColor::Hidden.hsla(cx)),
)
})
.text_size(ui_size(cx, 1.))
.text_size(rems(1.))
.when(self.line_height_style == LineHeightStyle::UILabel, |this| {
this.line_height(relative(1.))
})