From 3a326bfa7e05ea922e5092c8e5384da7d7f6e844 Mon Sep 17 00:00:00 2001 From: Nate Butler Date: Mon, 23 Oct 2023 11:05:17 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=A4=A6=20Remove=20references=20to=20syste?= =?UTF-8?q?m=5Fcolor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- crates/ui2/src/components/buffer.rs | 3 +-- crates/ui2/src/components/list.rs | 3 --- crates/ui2/src/components/panes.rs | 1 - crates/ui2/src/components/player_stack.rs | 4 ++-- crates/ui2/src/components/traffic_lights.rs | 8 +++----- crates/ui2/src/elements/input.rs | 3 +-- crates/ui2/src/prelude.rs | 3 +-- 7 files changed, 8 insertions(+), 17 deletions(-) diff --git a/crates/ui2/src/components/buffer.rs b/crates/ui2/src/components/buffer.rs index 84390653170d54d4994d4a1ac5086bb1ba308e1b..c684d2e24d9aa1a01ac73b5a33ca19a7f05691d2 100644 --- a/crates/ui2/src/components/buffer.rs +++ b/crates/ui2/src/components/buffer.rs @@ -159,13 +159,12 @@ impl Buffer { } fn render_row(row: BufferRow, cx: &WindowContext) -> impl Element { - let system_color = SystemColor::new(); let color = ThemeColor::new(cx); let line_background = if row.current { color.editor_active_line } else { - system_color.transparent + color.transparent }; let line_number_color = if row.current { diff --git a/crates/ui2/src/components/list.rs b/crates/ui2/src/components/list.rs index dea77d871886248598b7efb06f0281a7c4f5a6ef..114e73e4a2d1155aec952d86f1e23d9b0e71e6df 100644 --- a/crates/ui2/src/components/list.rs +++ b/crates/ui2/src/components/list.rs @@ -94,8 +94,6 @@ impl ListHeader { fn render(&mut self, _view: &mut S, cx: &mut ViewContext) -> impl Element { let color = ThemeColor::new(cx); - let system_color = SystemColor::new(); - let color = ThemeColor::new(cx); let is_toggleable = self.toggleable != Toggleable::NotToggleable; let is_toggled = self.toggleable.is_toggled(); @@ -373,7 +371,6 @@ impl ListEntry { fn render(&mut self, _view: &mut S, cx: &mut ViewContext) -> impl Element { let color = ThemeColor::new(cx); - let system_color = SystemColor::new(); let color = ThemeColor::new(cx); let settings = user_settings(cx); diff --git a/crates/ui2/src/components/panes.rs b/crates/ui2/src/components/panes.rs index 4cf2e28f058a143018b33ae4f884df3fdca5413e..48d4327cabe3ee0cc0f09f9e25600e0514a8567d 100644 --- a/crates/ui2/src/components/panes.rs +++ b/crates/ui2/src/components/panes.rs @@ -24,7 +24,6 @@ pub struct Pane { impl Pane { pub fn new(id: impl Into, size: Size) -> Self { // Fill is only here for debugging purposes, remove before release - let system_color = SystemColor::new(); Self { id: id.into(), diff --git a/crates/ui2/src/components/player_stack.rs b/crates/ui2/src/components/player_stack.rs index a5f76f4ab915d96c39c255120c6aa179ebdbe4c7..c7b0d52eefa22a96ab49c8b4d96891ec7ea49142 100644 --- a/crates/ui2/src/components/player_stack.rs +++ b/crates/ui2/src/components/player_stack.rs @@ -18,7 +18,7 @@ impl PlayerStack { } fn render(&mut self, _view: &mut S, cx: &mut ViewContext) -> impl Element { - let system_color = SystemColor::new(); + let color = ThemeColor::new(cx); let player = self.player_with_call_status.get_player(); self.player_with_call_status.get_call_status(); @@ -54,7 +54,7 @@ impl PlayerStack { .pl_1() .rounded_lg() .bg(if followers.is_none() { - system_color.transparent + color.transparent } else { player.selection_color(cx) }) diff --git a/crates/ui2/src/components/traffic_lights.rs b/crates/ui2/src/components/traffic_lights.rs index cf8d2b47d149bbda5a0353fb338562adfe826a74..58f252628dd9d304b0af98aa5d4cd0fc4043c9e0 100644 --- a/crates/ui2/src/components/traffic_lights.rs +++ b/crates/ui2/src/components/traffic_lights.rs @@ -1,7 +1,6 @@ use std::marker::PhantomData; use crate::prelude::*; -use crate::SystemColor; #[derive(Clone, Copy)] enum TrafficLightColor { @@ -28,12 +27,11 @@ impl TrafficLight { fn render(&mut self, _view: &mut S, cx: &mut ViewContext) -> impl Element { let color = ThemeColor::new(cx); - let system_color = SystemColor::new(); let fill = match (self.window_has_focus, self.color) { - (true, TrafficLightColor::Red) => system_color.mac_os_traffic_light_red, - (true, TrafficLightColor::Yellow) => system_color.mac_os_traffic_light_yellow, - (true, TrafficLightColor::Green) => system_color.mac_os_traffic_light_green, + (true, TrafficLightColor::Red) => color.mac_os_traffic_light_red, + (true, TrafficLightColor::Yellow) => color.mac_os_traffic_light_yellow, + (true, TrafficLightColor::Green) => color.mac_os_traffic_light_green, (false, _) => color.filled_element, }; diff --git a/crates/ui2/src/elements/input.rs b/crates/ui2/src/elements/input.rs index dc2a8b8d6346623cc295e1c8004c5a76ade0a066..eb2bdcdc25c2c23be1aae5ba663f4f5e3a46d53c 100644 --- a/crates/ui2/src/elements/input.rs +++ b/crates/ui2/src/elements/input.rs @@ -62,7 +62,6 @@ impl Input { fn render(&mut self, _view: &mut S, cx: &mut ViewContext) -> impl Element { let color = ThemeColor::new(cx); - let system_color = SystemColor::new(); let (input_bg, input_hover_bg, input_active_bg) = match self.variant { InputVariant::Ghost => ( @@ -95,7 +94,7 @@ impl Input { .w_full() .px_2() .border() - .border_color(system_color.transparent) + .border_color(color.transparent) .bg(input_bg) .hover(|style| style.bg(input_hover_bg)) .active(|style| style.bg(input_active_bg)) diff --git a/crates/ui2/src/prelude.rs b/crates/ui2/src/prelude.rs index 59d09c76a223fe2170e1f795aeb952f97ee02d58..c79c30ee6892866d6919527e604375aed8d2ea4f 100644 --- a/crates/ui2/src/prelude.rs +++ b/crates/ui2/src/prelude.rs @@ -61,10 +61,9 @@ impl GitStatus { pub fn hsla(&self, cx: &WindowContext) -> Hsla { let color = ThemeColor::new(cx); - let system_color = SystemColor::new(); match self { - Self::None => system_color.transparent, + Self::None => color.transparent, Self::Created => color.git_created, Self::Modified => color.git_modified, Self::Deleted => color.git_deleted,