WIP: layout compiling

This commit is contained in:
Mikayla 2023-11-29 14:38:27 -08:00
parent e99fa77bda
commit 39887be7d0
No known key found for this signature in database
7 changed files with 990 additions and 978 deletions

View file

@ -1,4 +1,4 @@
use gpui::{AppContext, FontFeatures, Pixels};
use gpui::{px, AbsoluteLength, AppContext, FontFeatures, Pixels};
use schemars::JsonSchema;
use serde_derive::{Deserialize, Serialize};
use std::{collections::HashMap, path::PathBuf};
@ -114,12 +114,13 @@ pub enum TerminalLineHeight {
}
impl TerminalLineHeight {
pub fn value(&self) -> f32 {
match self {
pub fn value(&self) -> AbsoluteLength {
let value = match self {
TerminalLineHeight::Comfortable => 1.618,
TerminalLineHeight::Standard => 1.3,
TerminalLineHeight::Custom(line_height) => f32::max(*line_height, 1.),
}
};
px(value).into()
}
}