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.

Make `TextSize::rems` take `AppContext` instead of `WindowContext` (#23220)

Michael Sloan0dbe34d2ae00
diff --git a/crates/ui/src/styles/typography.rs b/crates/ui/src/styles/typography.rs
index 314d5339f0c..51dec0fd1c9 100644
--- a/crates/ui/src/styles/typography.rs
+++ b/crates/ui/src/styles/typography.rs
@@ -1,5 +1,6 @@
use gpui::{
- div, rems, IntoElement, ParentElement, Rems, RenderOnce, SharedString, Styled, WindowContext,
+ div, rems, AppContext, IntoElement, ParentElement, Rems, RenderOnce, SharedString, Styled,
+ WindowContext,
};
use settings::Settings;
use theme::{ActiveTheme, ThemeSettings};
@@ -130,7 +131,7 @@ pub enum TextSize {
impl TextSize {
/// Returns the text size in rems.
- pub fn rems(self, cx: &WindowContext) -> Rems {
+ pub fn rems(self, cx: &AppContext) -> Rems {
let theme_settings = ThemeSettings::get_global(cx);
match self {