Remove references to old_theme
This commit is contained in:
parent
7bacdefa2e
commit
14d24a9ac6
5 changed files with 22 additions and 32 deletions
|
@ -3,8 +3,7 @@ use std::sync::Arc;
|
||||||
use chrono::DateTime;
|
use chrono::DateTime;
|
||||||
use gpui2::{px, relative, rems, AppContext, Context, Size, View};
|
use gpui2::{px, relative, rems, AppContext, Context, Size, View};
|
||||||
|
|
||||||
use crate::{
|
use crate::{static_livestream, user_settings_mut, v_stack, AssistantPanel, Button, ChatMessage,
|
||||||
old_theme, static_livestream, 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,
|
||||||
|
@ -179,7 +178,7 @@ impl Workspace {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Component<Self> {
|
pub fn render(&mut self, cx: &mut ViewContext<Self>) -> impl Component<Self> {
|
||||||
let theme = old_theme(cx).clone();
|
let theme = theme(cx);
|
||||||
|
|
||||||
// HACK: This should happen inside of `debug_toggle_user_settings`, but
|
// HACK: This should happen inside of `debug_toggle_user_settings`, but
|
||||||
// we don't have `cx.global::<FakeSettings>()` in event handlers at the moment.
|
// we don't have `cx.global::<FakeSettings>()` in event handlers at the moment.
|
||||||
|
@ -216,8 +215,8 @@ impl Workspace {
|
||||||
.gap_0()
|
.gap_0()
|
||||||
.justify_start()
|
.justify_start()
|
||||||
.items_start()
|
.items_start()
|
||||||
.text_color(theme.lowest.base.default.foreground)
|
.text_color(theme.text)
|
||||||
.bg(theme.lowest.base.default.background)
|
.bg(theme.background)
|
||||||
.child(self.title_bar.clone())
|
.child(self.title_bar.clone())
|
||||||
.child(
|
.child(
|
||||||
div()
|
div()
|
||||||
|
@ -228,7 +227,7 @@ impl Workspace {
|
||||||
.overflow_hidden()
|
.overflow_hidden()
|
||||||
.border_t()
|
.border_t()
|
||||||
.border_b()
|
.border_b()
|
||||||
.border_color(theme.lowest.base.default.border)
|
.border_color(theme.border)
|
||||||
.children(
|
.children(
|
||||||
Some(
|
Some(
|
||||||
Panel::new("project-panel-outer", cx)
|
Panel::new("project-panel-outer", cx)
|
||||||
|
|
|
@ -2,7 +2,6 @@ use gpui2::{svg, Hsla};
|
||||||
use strum::EnumIter;
|
use strum::EnumIter;
|
||||||
|
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
use crate::theme::old_theme;
|
|
||||||
|
|
||||||
#[derive(Default, PartialEq, Copy, Clone)]
|
#[derive(Default, PartialEq, Copy, Clone)]
|
||||||
pub enum IconSize {
|
pub enum IconSize {
|
||||||
|
@ -27,17 +26,17 @@ pub enum IconColor {
|
||||||
|
|
||||||
impl IconColor {
|
impl IconColor {
|
||||||
pub fn color(self, cx: &WindowContext) -> Hsla {
|
pub fn color(self, cx: &WindowContext) -> Hsla {
|
||||||
let theme = old_theme(cx);
|
let theme = theme(cx);
|
||||||
match self {
|
match self {
|
||||||
IconColor::Default => theme.lowest.base.default.foreground,
|
IconColor::Default => gpui2::red(),
|
||||||
IconColor::Muted => theme.lowest.variant.default.foreground,
|
IconColor::Muted => gpui2::red(),
|
||||||
IconColor::Disabled => theme.lowest.base.disabled.foreground,
|
IconColor::Disabled => gpui2::red(),
|
||||||
IconColor::Placeholder => theme.lowest.base.disabled.foreground,
|
IconColor::Placeholder => gpui2::red(),
|
||||||
IconColor::Accent => theme.lowest.accent.default.foreground,
|
IconColor::Accent => gpui2::red(),
|
||||||
IconColor::Error => theme.lowest.negative.default.foreground,
|
IconColor::Error => gpui2::red(),
|
||||||
IconColor::Warning => theme.lowest.warning.default.foreground,
|
IconColor::Warning => gpui2::red(),
|
||||||
IconColor::Success => theme.lowest.positive.default.foreground,
|
IconColor::Success => gpui2::red(),
|
||||||
IconColor::Info => theme.lowest.accent.default.foreground,
|
IconColor::Info => gpui2::red()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,6 @@ use gpui2::{relative, Hsla, WindowContext};
|
||||||
use smallvec::SmallVec;
|
use smallvec::SmallVec;
|
||||||
|
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
use crate::theme::old_theme;
|
|
||||||
|
|
||||||
#[derive(Default, PartialEq, Copy, Clone)]
|
#[derive(Default, PartialEq, Copy, Clone)]
|
||||||
pub enum LabelColor {
|
pub enum LabelColor {
|
||||||
#[default]
|
#[default]
|
||||||
|
@ -21,19 +19,17 @@ pub enum LabelColor {
|
||||||
impl LabelColor {
|
impl LabelColor {
|
||||||
pub fn hsla(&self, cx: &WindowContext) -> Hsla {
|
pub fn hsla(&self, cx: &WindowContext) -> Hsla {
|
||||||
let theme = theme(cx);
|
let theme = theme(cx);
|
||||||
// TODO: Remove
|
|
||||||
let old_theme = old_theme(cx);
|
|
||||||
|
|
||||||
match self {
|
match self {
|
||||||
Self::Default => theme.text,
|
Self::Default => theme.text,
|
||||||
Self::Muted => theme.text_muted,
|
Self::Muted => theme.text_muted,
|
||||||
Self::Created => old_theme.middle.positive.default.foreground,
|
Self::Created => gpui2::red(),
|
||||||
Self::Modified => old_theme.middle.warning.default.foreground,
|
Self::Modified => gpui2::red(),
|
||||||
Self::Deleted => old_theme.middle.negative.default.foreground,
|
Self::Deleted => gpui2::red(),
|
||||||
Self::Disabled => theme.text_disabled,
|
Self::Disabled => theme.text_disabled,
|
||||||
Self::Hidden => old_theme.middle.variant.default.foreground,
|
Self::Hidden => gpui2::red(),
|
||||||
Self::Placeholder => theme.text_placeholder,
|
Self::Placeholder => theme.text_placeholder,
|
||||||
Self::Accent => old_theme.middle.accent.default.foreground,
|
Self::Accent => gpui2::red(),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@ pub use gpui2::{
|
||||||
|
|
||||||
pub use crate::elevation::*;
|
pub use crate::elevation::*;
|
||||||
use crate::settings::user_settings;
|
use crate::settings::user_settings;
|
||||||
pub use crate::{old_theme, theme, ButtonVariant};
|
pub use crate::{theme, ButtonVariant};
|
||||||
|
|
||||||
use gpui2::{rems, Hsla, Rems};
|
use gpui2::{rems, Hsla, Rems};
|
||||||
use strum::EnumIter;
|
use strum::EnumIter;
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
use gpui2::{AppContext, Hsla, Result, WindowContext};
|
use gpui2::{AppContext, Hsla, Result};
|
||||||
use serde::{de::Visitor, Deserialize, Deserializer};
|
use serde::{de::Visitor, Deserialize, Deserializer};
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
use std::fmt;
|
use std::fmt;
|
||||||
|
@ -129,10 +129,6 @@ where
|
||||||
deserializer.deserialize_map(SyntaxVisitor)
|
deserializer.deserialize_map(SyntaxVisitor)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn old_theme(cx: &WindowContext) -> Arc<Theme> {
|
|
||||||
Arc::new(cx.global::<Theme>().clone())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn theme(cx: &AppContext) -> Arc<theme2::Theme> {
|
pub fn theme(cx: &AppContext) -> Arc<theme2::Theme> {
|
||||||
theme2::active_theme(cx).clone()
|
theme2::active_theme(cx).clone()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue