Rename theme getter to old_theme

This commit is contained in:
Marshall Bowers 2023-10-25 16:02:47 +02:00
parent 8043d0d8a9
commit 258496700f
6 changed files with 12 additions and 12 deletions

View file

@ -1,5 +1,5 @@
use crate::theme2; 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 gpui2::{hsla, rgb, Hsla, WindowContext};
use strum::EnumIter; use strum::EnumIter;
@ -20,7 +20,7 @@ impl std::fmt::Debug for PlayerThemeColors {
impl PlayerThemeColors { impl PlayerThemeColors {
pub fn new(cx: &WindowContext, ix: usize) -> Self { pub fn new(cx: &WindowContext, ix: usize) -> Self {
let theme = theme(cx); let theme = old_theme(cx);
if ix < theme.players.len() { if ix < theme.players.len() {
Self { Self {
@ -57,7 +57,7 @@ impl std::fmt::Debug for SyntaxColor {
impl SyntaxColor { impl SyntaxColor {
pub fn new(cx: &WindowContext) -> Self { pub fn new(cx: &WindowContext) -> Self {
let theme = theme(cx); let theme = old_theme(cx);
Self { Self {
comment: theme comment: theme
@ -253,7 +253,7 @@ impl std::fmt::Debug for ThemeColor {
impl ThemeColor { impl ThemeColor {
pub fn new(cx: &WindowContext) -> Self { pub fn new(cx: &WindowContext) -> Self {
let theme = theme(cx); let theme = old_theme(cx);
let theme2 = theme2(cx); let theme2 = theme2(cx);
let transparent = hsla(0.0, 0.0, 0.0, 0.0); let transparent = hsla(0.0, 0.0, 0.0, 0.0);

View file

@ -5,7 +5,7 @@ use gpui2::{px, relative, rems, view, Context, Size, View};
use crate::{prelude::*, NotificationsPanel}; use crate::{prelude::*, NotificationsPanel};
use crate::{ 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, ChatPanel, CollabPanel, EditorPane, FakeSettings, Label, LanguageSelector, Pane, PaneGroup,
Panel, PanelAllowedSides, PanelSide, ProjectPanel, SettingValue, SplitDirection, StatusBar, Panel, PanelAllowedSides, PanelSide, ProjectPanel, SettingValue, SplitDirection, StatusBar,
Terminal, TitleBar, Toast, ToastOrigin, Terminal, TitleBar, Toast, ToastOrigin,
@ -175,7 +175,7 @@ impl Workspace {
} }
pub fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Element<ViewState = Self> { 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); let color = ThemeColor::new(cx);

View file

@ -4,7 +4,7 @@ use gpui2::{svg, Hsla};
use strum::EnumIter; use strum::EnumIter;
use crate::prelude::*; use crate::prelude::*;
use crate::theme::theme; use crate::theme::old_theme;
#[derive(Default, PartialEq, Copy, Clone)] #[derive(Default, PartialEq, Copy, Clone)]
pub enum IconSize { pub enum IconSize {
@ -29,7 +29,7 @@ pub enum IconColor {
impl IconColor { impl IconColor {
pub fn color(self, cx: &WindowContext) -> Hsla { pub fn color(self, cx: &WindowContext) -> Hsla {
let theme = theme(cx); let theme = old_theme(cx);
match self { match self {
IconColor::Default => theme.lowest.base.default.foreground, IconColor::Default => theme.lowest.base.default.foreground,
IconColor::Muted => theme.lowest.variant.default.foreground, IconColor::Muted => theme.lowest.variant.default.foreground,

View file

@ -4,7 +4,7 @@ use gpui2::{relative, Hsla, WindowContext};
use smallvec::SmallVec; use smallvec::SmallVec;
use crate::prelude::*; use crate::prelude::*;
use crate::theme::theme; use crate::theme::old_theme;
#[derive(Default, PartialEq, Copy, Clone)] #[derive(Default, PartialEq, Copy, Clone)]
pub enum LabelColor { pub enum LabelColor {
@ -24,7 +24,7 @@ impl LabelColor {
pub fn hsla(&self, cx: &WindowContext) -> Hsla { pub fn hsla(&self, cx: &WindowContext) -> Hsla {
let color = ThemeColor::new(cx); let color = ThemeColor::new(cx);
// TODO: Remove // TODO: Remove
let theme = theme(cx); let theme = old_theme(cx);
match self { match self {
Self::Default => color.text, Self::Default => color.text,

View file

@ -6,7 +6,7 @@ pub use gpui2::{
pub use crate::color::*; pub use crate::color::*;
pub use crate::elevation::*; pub use crate::elevation::*;
use crate::settings::user_settings; 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 gpui2::{rems, Hsla, Rems};
use strum::EnumIter; use strum::EnumIter;

View file

@ -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()) Arc::new(cx.global::<Theme>().clone())
} }