From 08585d53afe7df62393e1bbcbac021e432e13069 Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Thu, 16 Jan 2025 03:01:04 -0700 Subject: [PATCH] Make `TextSize::rems` take `AppContext` instead of `WindowContext` Motivation for this change is #23113, but this will also be the state of it after the gpui refactor. --- crates/ui/src/styles/typography.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/ui/src/styles/typography.rs b/crates/ui/src/styles/typography.rs index 314d5339f0c14d..51dec0fd1c9f9b 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 {