Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Init rem_size in the workspace at the start of the render

Nate Butlerfa9f4a935554
diff --git a/crates/workspace2/src/workspace2.rs b/crates/workspace2/src/workspace2.rs
index f28675661de..e09624bd2cb 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>) -> 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)