Scale diagnostic header and message text with editor font
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
0c6fd157ee
commit
78b57e4d9d
7 changed files with 78 additions and 46 deletions
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue