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

@ -4,21 +4,12 @@ pub use gpui2::{
};
pub use crate::elevation::*;
use crate::settings::user_settings;
pub use crate::ButtonVariant;
pub use theme2::ActiveTheme;
use gpui2::{rems, Hsla, Rems};
use gpui2::Hsla;
use strum::EnumIter;
pub fn ui_size(cx: &mut WindowContext, size: f32) -> Rems {
const UI_SCALE_RATIO: f32 = 0.875;
let settings = user_settings(cx);
rems(*settings.ui_scale * UI_SCALE_RATIO * size)
}
#[derive(Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash, Clone, Copy, EnumIter)]
pub enum FileSystemStatus {
#[default]