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:
parent
bd61d71018
commit
b910bbf002
12 changed files with 58 additions and 50 deletions
|
@ -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]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue