Update line heights, buttons to respond to UI scale

Co-Authored-By: Marshall Bowers <1486634+maxdeviant@users.noreply.github.com>
This commit is contained in:
Nate Butler
2023-10-18 17:55:17 -04:00
co-authored by Marshall Bowers
parent 7b2782c0f6
commit 7cb00aeb34
6 changed files with 47 additions and 13 deletions
+12 -2
View File
@@ -1,6 +1,6 @@
use crate::{
self as gpui3, hsla, point, px, relative, rems, AlignItems, Display, Fill, FlexDirection, Hsla,
JustifyContent, Length, Position, Rems, SharedString, StyleRefinement,
self as gpui3, hsla, point, px, relative, rems, AlignItems, DefiniteLength, Display, Fill,
FlexDirection, Hsla, JustifyContent, Length, Position, Rems, SharedString, StyleRefinement,
};
use crate::{BoxShadow, TextStyleRefinement};
use smallvec::smallvec;
@@ -529,4 +529,14 @@ pub trait Styled {
.font_family = Some(family_name.into());
self
}
fn line_height(mut self, line_height: impl Into<DefiniteLength>) -> Self
where
Self: Sized,
{
self.text_style()
.get_or_insert_with(Default::default)
.line_height = Some(line_height.into());
self
}
}