Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Rename `theme` getter to `old_theme`
Marshall Bowers258496700f13
diff --git a/crates/ui2/src/color.rs b/crates/ui2/src/color.rsindex 51bf0003cb1..dcca95ae961 100644--- a/crates/ui2/src/color.rs+++ b/crates/ui2/src/color.rs@@ -1,5 +1,5 @@use crate::theme2;-pub use crate::{theme, ButtonVariant, ElementExt, Theme};+pub use crate::{old_theme, ButtonVariant, ElementExt, Theme};use gpui2::{hsla, rgb, Hsla, WindowContext};use strum::EnumIter;@@ -20,7 +20,7 @@ impl std::fmt::Debug for PlayerThemeColors {impl PlayerThemeColors {pub fn new(cx: &WindowContext, ix: usize) -> Self {- let theme = theme(cx);+ let theme = old_theme(cx);if ix < theme.players.len() {Self {@@ -57,7 +57,7 @@ impl std::fmt::Debug for SyntaxColor {impl SyntaxColor {pub fn new(cx: &WindowContext) -> Self {- let theme = theme(cx);+ let theme = old_theme(cx);Self {comment: theme@@ -253,7 +253,7 @@ impl std::fmt::Debug for ThemeColor {impl ThemeColor {pub fn new(cx: &WindowContext) -> Self {- let theme = theme(cx);+ let theme = old_theme(cx);let theme2 = theme2(cx);let transparent = hsla(0.0, 0.0, 0.0, 0.0);diff --git a/crates/ui2/src/components/workspace.rs b/crates/ui2/src/components/workspace.rsindex ff51220053d..e26ce6d659e 100644--- a/crates/ui2/src/components/workspace.rs+++ b/crates/ui2/src/components/workspace.rs@@ -5,7 +5,7 @@ use gpui2::{px, relative, rems, view, Context, Size, View};use crate::{prelude::*, NotificationsPanel};use crate::{- static_livestream, theme, user_settings_mut, v_stack, AssistantPanel, Button, ChatMessage,+ static_livestream, old_theme, user_settings_mut, v_stack, AssistantPanel, Button, ChatMessage,ChatPanel, CollabPanel, EditorPane, FakeSettings, Label, LanguageSelector, Pane, PaneGroup,Panel, PanelAllowedSides, PanelSide, ProjectPanel, SettingValue, SplitDirection, StatusBar,Terminal, TitleBar, Toast, ToastOrigin,@@ -175,7 +175,7 @@ impl Workspace {}pub fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element<ViewState = Self> {- let theme = theme(cx).clone();+ let theme = old_theme(cx).clone();let color = ThemeColor::new(cx);diff --git a/crates/ui2/src/elements/icon.rs b/crates/ui2/src/elements/icon.rsindex e89309b5e6a..9f2d174accc 100644--- a/crates/ui2/src/elements/icon.rs+++ b/crates/ui2/src/elements/icon.rs@@ -4,7 +4,7 @@ use gpui2::{svg, Hsla};use strum::EnumIter;use crate::prelude::*;-use crate::theme::theme;+use crate::theme::old_theme;#[derive(Default, PartialEq, Copy, Clone)]pub enum IconSize {@@ -29,7 +29,7 @@ pub enum IconColor {impl IconColor {pub fn color(self, cx: &WindowContext) -> Hsla {- let theme = theme(cx);+ let theme = old_theme(cx);match self {IconColor::Default => theme.lowest.base.default.foreground,IconColor::Muted => theme.lowest.variant.default.foreground,diff --git a/crates/ui2/src/elements/label.rs b/crates/ui2/src/elements/label.rsindex c57de26dd77..bea301c1c21 100644--- a/crates/ui2/src/elements/label.rs+++ b/crates/ui2/src/elements/label.rs@@ -4,7 +4,7 @@ use gpui2::{relative, Hsla, WindowContext};use smallvec::SmallVec;use crate::prelude::*;-use crate::theme::theme;+use crate::theme::old_theme;#[derive(Default, PartialEq, Copy, Clone)]pub enum LabelColor {@@ -24,7 +24,7 @@ impl LabelColor {pub fn hsla(&self, cx: &WindowContext) -> Hsla {let color = ThemeColor::new(cx);// TODO: Remove- let theme = theme(cx);+ let theme = old_theme(cx);match self {Self::Default => color.text,diff --git a/crates/ui2/src/prelude.rs b/crates/ui2/src/prelude.rsindex 05f21f0a249..8b8ad30b919 100644--- a/crates/ui2/src/prelude.rs+++ b/crates/ui2/src/prelude.rs@@ -6,7 +6,7 @@ pub use gpui2::{pub use crate::color::*;pub use crate::elevation::*;use crate::settings::user_settings;-pub use crate::{theme, ButtonVariant, ElementExt, Theme};+pub use crate::{old_theme, ButtonVariant, ElementExt, Theme};use gpui2::{rems, Hsla, Rems};use strum::EnumIter;diff --git a/crates/ui2/src/theme.rs b/crates/ui2/src/theme.rsindex 0448a31db94..e921019e703 100644--- a/crates/ui2/src/theme.rs+++ b/crates/ui2/src/theme.rs@@ -214,7 +214,7 @@ where}}-pub fn theme(cx: &WindowContext) -> Arc<Theme> {+pub fn old_theme(cx: &WindowContext) -> Arc<Theme> {Arc::new(cx.global::<Theme>().clone())}