Move font size adjustment code to the theme crate

This commit is contained in:
Max Brunsfeld 2023-05-17 15:56:32 -07:00
parent 258723566f
commit 42eca3048f
10 changed files with 69 additions and 56 deletions

View file

@ -682,9 +682,7 @@ fn diagnostic_header_renderer(diagnostic: Diagnostic) -> RenderBlock {
let settings = settings::get::<ThemeSettings>(cx);
let theme = &settings.theme.editor;
let style = theme.diagnostic_header.clone();
let font_size = (style.text_scale_factor
* settings::font_size_for_setting(settings.buffer_font_size, cx))
.round();
let font_size = (style.text_scale_factor * settings.buffer_font_size(cx)).round();
let icon_width = cx.em_width * style.icon_width_factor;
let icon = if diagnostic.severity == DiagnosticSeverity::ERROR {
Svg::new("icons/circle_x_mark_12.svg")