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
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
use gpui::{
|
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 settings::Settings;
|
||||||
use theme::{ActiveTheme, ThemeSettings};
|
use theme::{ActiveTheme, ThemeSettings};
|
||||||
@@ -130,7 +131,7 @@ pub enum TextSize {
|
|||||||
|
|
||||||
impl TextSize {
|
impl TextSize {
|
||||||
/// Returns the text size in rems.
|
/// 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);
|
let theme_settings = ThemeSettings::get_global(cx);
|
||||||
|
|
||||||
match self {
|
match self {
|
||||||
|
|||||||
Reference in New Issue
Block a user