🤦 Remove references to system_color

This commit is contained in:
Nate Butler 2023-10-23 11:05:17 -04:00
parent dd55ccef34
commit 3a326bfa7e
7 changed files with 8 additions and 17 deletions

View file

@ -159,13 +159,12 @@ impl<S: 'static + Send + Sync + Clone> Buffer<S> {
} }
fn render_row(row: BufferRow, cx: &WindowContext) -> impl Element<ViewState = S> { fn render_row(row: BufferRow, cx: &WindowContext) -> impl Element<ViewState = S> {
let system_color = SystemColor::new();
let color = ThemeColor::new(cx); let color = ThemeColor::new(cx);
let line_background = if row.current { let line_background = if row.current {
color.editor_active_line color.editor_active_line
} else { } else {
system_color.transparent color.transparent
}; };
let line_number_color = if row.current { let line_number_color = if row.current {

View file

@ -94,8 +94,6 @@ impl<S: 'static + Send + Sync> ListHeader<S> {
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> { fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
let color = ThemeColor::new(cx); let color = ThemeColor::new(cx);
let system_color = SystemColor::new();
let color = ThemeColor::new(cx);
let is_toggleable = self.toggleable != Toggleable::NotToggleable; let is_toggleable = self.toggleable != Toggleable::NotToggleable;
let is_toggled = self.toggleable.is_toggled(); let is_toggled = self.toggleable.is_toggled();
@ -373,7 +371,6 @@ impl<S: 'static + Send + Sync> ListEntry<S> {
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> { fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
let color = ThemeColor::new(cx); let color = ThemeColor::new(cx);
let system_color = SystemColor::new();
let color = ThemeColor::new(cx); let color = ThemeColor::new(cx);
let settings = user_settings(cx); let settings = user_settings(cx);

View file

@ -24,7 +24,6 @@ pub struct Pane<S: 'static + Send + Sync> {
impl<S: 'static + Send + Sync> Pane<S> { impl<S: 'static + Send + Sync> Pane<S> {
pub fn new(id: impl Into<ElementId>, size: Size<Length>) -> Self { pub fn new(id: impl Into<ElementId>, size: Size<Length>) -> Self {
// Fill is only here for debugging purposes, remove before release // Fill is only here for debugging purposes, remove before release
let system_color = SystemColor::new();
Self { Self {
id: id.into(), id: id.into(),

View file

@ -18,7 +18,7 @@ impl<S: 'static + Send + Sync> PlayerStack<S> {
} }
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> { fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
let system_color = SystemColor::new(); let color = ThemeColor::new(cx);
let player = self.player_with_call_status.get_player(); let player = self.player_with_call_status.get_player();
self.player_with_call_status.get_call_status(); self.player_with_call_status.get_call_status();
@ -54,7 +54,7 @@ impl<S: 'static + Send + Sync> PlayerStack<S> {
.pl_1() .pl_1()
.rounded_lg() .rounded_lg()
.bg(if followers.is_none() { .bg(if followers.is_none() {
system_color.transparent color.transparent
} else { } else {
player.selection_color(cx) player.selection_color(cx)
}) })

View file

@ -1,7 +1,6 @@
use std::marker::PhantomData; use std::marker::PhantomData;
use crate::prelude::*; use crate::prelude::*;
use crate::SystemColor;
#[derive(Clone, Copy)] #[derive(Clone, Copy)]
enum TrafficLightColor { enum TrafficLightColor {
@ -28,12 +27,11 @@ impl<S: 'static + Send + Sync> TrafficLight<S> {
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> { fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
let color = ThemeColor::new(cx); let color = ThemeColor::new(cx);
let system_color = SystemColor::new();
let fill = match (self.window_has_focus, self.color) { let fill = match (self.window_has_focus, self.color) {
(true, TrafficLightColor::Red) => system_color.mac_os_traffic_light_red, (true, TrafficLightColor::Red) => color.mac_os_traffic_light_red,
(true, TrafficLightColor::Yellow) => system_color.mac_os_traffic_light_yellow, (true, TrafficLightColor::Yellow) => color.mac_os_traffic_light_yellow,
(true, TrafficLightColor::Green) => system_color.mac_os_traffic_light_green, (true, TrafficLightColor::Green) => color.mac_os_traffic_light_green,
(false, _) => color.filled_element, (false, _) => color.filled_element,
}; };

View file

@ -62,7 +62,6 @@ impl<S: 'static + Send + Sync> Input<S> {
fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> { fn render(&mut self, _view: &mut S, cx: &mut ViewContext<S>) -> impl Element<ViewState = S> {
let color = ThemeColor::new(cx); let color = ThemeColor::new(cx);
let system_color = SystemColor::new();
let (input_bg, input_hover_bg, input_active_bg) = match self.variant { let (input_bg, input_hover_bg, input_active_bg) = match self.variant {
InputVariant::Ghost => ( InputVariant::Ghost => (
@ -95,7 +94,7 @@ impl<S: 'static + Send + Sync> Input<S> {
.w_full() .w_full()
.px_2() .px_2()
.border() .border()
.border_color(system_color.transparent) .border_color(color.transparent)
.bg(input_bg) .bg(input_bg)
.hover(|style| style.bg(input_hover_bg)) .hover(|style| style.bg(input_hover_bg))
.active(|style| style.bg(input_active_bg)) .active(|style| style.bg(input_active_bg))

View file

@ -61,10 +61,9 @@ impl GitStatus {
pub fn hsla(&self, cx: &WindowContext) -> Hsla { pub fn hsla(&self, cx: &WindowContext) -> Hsla {
let color = ThemeColor::new(cx); let color = ThemeColor::new(cx);
let system_color = SystemColor::new();
match self { match self {
Self::None => system_color.transparent, Self::None => color.transparent,
Self::Created => color.git_created, Self::Created => color.git_created,
Self::Modified => color.git_modified, Self::Modified => color.git_modified,
Self::Deleted => color.git_deleted, Self::Deleted => color.git_deleted,