From fa9f4a935554758ee9a3f17485ba3b50ebe913af Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Thu, 16 Nov 2023 13:43:36 -0500 Subject: [PATCH] Init rem_size in the workspace at the start of the render Co-Authored-By: Mikayla Maki --- crates/workspace2/src/workspace2.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/workspace2/src/workspace2.rs b/crates/workspace2/src/workspace2.rs index f28675661d..e09624bd2c 100644 --- a/crates/workspace2/src/workspace2.rs +++ b/crates/workspace2/src/workspace2.rs @@ -3614,7 +3614,16 @@ impl Render for Workspace { fn render(&mut self, cx: &mut ViewContext) -> Self::Element { let mut context = KeyContext::default(); context.add("Workspace"); - let ui_font = ThemeSettings::get_global(cx).ui_font.family.clone(); + + let (ui_font, ui_font_size) = { + let theme_settings = ThemeSettings::get_global(cx); + ( + theme_settings.ui_font.family.clone(), + theme_settings.ui_font_size.clone(), + ) + }; + + cx.set_rem_size(ui_font_size); self.add_workspace_actions_listeners(div()) .key_context(context)