Scale diagnostic header and message text with editor font

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld 2022-01-25 12:10:11 -08:00
parent 0c6fd157ee
commit 78b57e4d9d
7 changed files with 78 additions and 46 deletions

View file

@ -33,6 +33,13 @@ impl From<TextStyle> for LabelStyle {
}
}
impl LabelStyle {
pub fn with_font_size(mut self, font_size: f32) -> Self {
self.text.font_size = font_size;
self
}
}
impl Label {
pub fn new(text: String, style: impl Into<LabelStyle>) -> Self {
Self {

View file

@ -107,6 +107,11 @@ impl TextStyle {
})
}
pub fn with_font_size(mut self, font_size: f32) -> Self {
self.font_size = font_size;
self
}
pub fn to_run(&self) -> RunStyle {
RunStyle {
font_id: self.font_id,