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 @@
11 use gpui::{
2− div, rems, IntoElement, ParentElement, Rems, RenderOnce, SharedString, Styled, WindowContext,
2+ div, rems, AppContext, IntoElement, ParentElement, Rems, RenderOnce, SharedString, Styled,
3+ WindowContext,
34 };
45 use settings::Settings;
56 use theme::{ActiveTheme, ThemeSettings};
@@ -130,7 +131,7 @@ pub enum TextSize { · 124 unmodified lines
130131
131132 impl TextSize {
132133 /// Returns the text size in rems.
133− pub fn rems(self, cx: &WindowContext) -> Rems {
134+ pub fn rems(self, cx: &AppContext) -> Rems {
134135 let theme_settings = ThemeSettings::get_global(cx);
135136
136137 match self {