Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Checkpoint

Nate Butler5361a499aedf
diff --git a/crates/theme2/src/default_colors.rs b/crates/theme2/src/default_colors.rs
index 3e913905f37..43d6259e52d 100644
--- a/crates/theme2/src/default_colors.rs
+++ b/crates/theme2/src/default_colors.rs
@@ -114,27 +114,6 @@ impl Default for SystemColors {
}
}
-impl Default for StatusColors {
- fn default() -> Self {
- Self {
- conflict: red().dark().step_9(),
- created: grass().dark().step_9(),
- deleted: red().dark().step_9(),
- error: red().dark().step_9(),
- hidden: neutral().dark().step_9(),
- hint: blue().dark().step_9(),
- ignored: neutral().dark().step_9(),
- info: blue().dark().step_9(),
- modified: yellow().dark().step_9(),
- predictive: neutral().dark_alpha().step_9(),
- renamed: blue().dark().step_9(),
- success: grass().dark().step_9(),
- unreachable: neutral().dark().step_10(),
- warning: yellow().dark().step_9(),
- }
- }
-}
-
impl SyntaxTheme {
pub fn default_light() -> Self {
Self {
diff --git a/crates/theme2/src/default_theme.rs b/crates/theme2/src/default_theme.rs
index 40fb7df7cfd..4e8caf67b13 100644
--- a/crates/theme2/src/default_theme.rs
+++ b/crates/theme2/src/default_theme.rs
@@ -13,7 +13,7 @@ fn zed_pro_daylight() -> Theme {
styles: ThemeStyles {
system: SystemColors::default(),
colors: ThemeColors::default_light(),
- status: StatusColors::default(),
+ status: StatusColors::light(),
player: PlayerColors::default_light(),
syntax: Arc::new(SyntaxTheme::default_light()),
},
@@ -28,7 +28,7 @@ pub(crate) fn zed_pro_moonlight() -> Theme {
styles: ThemeStyles {
system: SystemColors::default(),
colors: ThemeColors::default_dark(),
- status: StatusColors::default(),
+ status: StatusColors::dark(),
player: PlayerColors::default(),
syntax: Arc::new(SyntaxTheme::default_dark()),
},
diff --git a/crates/theme2/src/registry.rs b/crates/theme2/src/registry.rs
index 0c61f6f2246..a28c59b6e1f 100644
--- a/crates/theme2/src/registry.rs
+++ b/crates/theme2/src/registry.rs
@@ -43,7 +43,7 @@ impl ThemeRegistry {
};
theme_colors.refine(&user_theme.styles.colors);
- let mut status_colors = StatusColors::default();
+ let mut status_colors = StatusColors::dark();
status_colors.refine(&user_theme.styles.status);
let mut syntax_colors = match user_theme.appearance {
diff --git a/crates/theme2/src/styles.rs b/crates/theme2/src/styles.rs
new file mode 100644
index 00000000000..0a44e2a4680
--- /dev/null
+++ b/crates/theme2/src/styles.rs
@@ -0,0 +1,3 @@
+mod status;
+
+use status::*;
diff --git a/crates/theme2/src/styles/status.rs b/crates/theme2/src/styles/status.rs
new file mode 100644
index 00000000000..87f9da96eee
--- /dev/null
+++ b/crates/theme2/src/styles/status.rs
@@ -0,0 +1,41 @@
+use crate::StatusColors;
+
+impl StatusColors {
+ pub fn dark() -> Self {
+ Self {
+ conflict: red().dark().step_9(),
+ created: grass().dark().step_9(),
+ deleted: red().dark().step_9(),
+ error: red().dark().step_9(),
+ hidden: neutral().dark().step_9(),
+ hint: blue().dark().step_9(),
+ ignored: neutral().dark().step_9(),
+ info: blue().dark().step_9(),
+ modified: yellow().dark().step_9(),
+ predictive: neutral().dark_alpha().step_9(),
+ renamed: blue().dark().step_9(),
+ success: grass().dark().step_9(),
+ unreachable: neutral().dark().step_10(),
+ warning: yellow().dark().step_9(),
+ }
+ }
+
+ pub fn light() -> Self {
+ Self {
+ conflict: red().light().step_9(),
+ created: grass().light().step_9(),
+ deleted: red().light().step_9(),
+ error: red().light().step_9(),
+ hidden: neutral().light().step_9(),
+ hint: blue().light().step_9(),
+ ignored: neutral().light().step_9(),
+ info: blue().light().step_9(),
+ modified: yellow().light().step_9(),
+ predictive: neutral().light_alpha().step_9(),
+ renamed: blue().light().step_9(),
+ success: grass().light().step_9(),
+ unreachable: neutral().light().step_10(),
+ warning: yellow().light().step_9(),
+ }
+ }
+}
diff --git a/crates/theme2/src/theme2.rs b/crates/theme2/src/theme2.rs
index 7e2085de4e7..0d6600eca68 100644
--- a/crates/theme2/src/theme2.rs
+++ b/crates/theme2/src/theme2.rs
@@ -5,6 +5,7 @@ mod players;
mod registry;
mod scale;
mod settings;
+mod styles;
mod syntax;
#[cfg(not(feature = "importing-themes"))]
mod themes;
@@ -20,6 +21,7 @@ pub use players::*;
pub use registry::*;
pub use scale::*;
pub use settings::*;
+pub use styles::*;
pub use syntax::*;
#[cfg(not(feature = "importing-themes"))]
pub use themes::*;