History

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

Motivation for this change is #23113, but this will also be the state of it after the gpui refactor. Release Notes: - N/A

Michael Sloan committed 1 year ago

Commit 0dbe34d1 parent 880f3ff1 file · +3 −2Browse files

Unified · Split

crates/ui/src/styles/typography.rs+3−2
@@ -1,5 +1,6 @@
1use gpui::{1use gpui::{
2 div, rems, IntoElement, ParentElement, Rems, RenderOnce, SharedString, Styled, WindowContext,2 div, rems, AppContext, IntoElement, ParentElement, Rems, RenderOnce, SharedString, Styled,
3 WindowContext,
3};4};
4use settings::Settings;5use settings::Settings;
5use theme::{ActiveTheme, ThemeSettings};6use theme::{ActiveTheme, ThemeSettings};
@@ -130,7 +131,7 @@ pub enum TextSize { · 124 unmodified lines
130 131
131impl TextSize {132impl TextSize {
132 /// Returns the text size in rems.133 /// Returns the text size in rems.
133 pub fn rems(self, cx: &WindowContext) -> Rems {134 pub fn rems(self, cx: &AppContext) -> Rems {
134 let theme_settings = ThemeSettings::get_global(cx);135 let theme_settings = ThemeSettings::get_global(cx);
135 136
136 match self {137 match self {