From 0f8ddf2fe29eae54920835c7abb86bcc5ddb9a3d Mon Sep 17 00:00:00 2001 From: Ali Date: Thu, 21 Nov 2024 12:09:22 -0500 Subject: [PATCH] [Add] Pastel and Light theme(s). --- config.toml | 2 +- src/themes.rs | 32 ++++++++++++++++++++++++++++++++ src/ui.rs | 6 ++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/config.toml b/config.toml index 50bf072..3bba80f 100644 --- a/config.toml +++ b/config.toml @@ -1,5 +1,5 @@ [theme] -name = "solarized-dark" +name = "light" [font] family = "IBM Plex Sans Arabic" diff --git a/src/themes.rs b/src/themes.rs index 03d0d47..5244d89 100644 --- a/src/themes.rs +++ b/src/themes.rs @@ -17,6 +17,38 @@ pub struct Theme { pub fn get_theme(name: &str) -> Theme { match name { + "pastel" => Theme { + background: "#f7f3f7", + editor_bg: "#fdfafd", + editor_bg_focus: "#ffffff", + text: "#4a4a4a", + popup_bg: "#fdfafd", + popup_border: "#e8d4e8", + popup_shadow: "rgba(0, 0, 0, 0.1)", + suggestion_text: "#4a4a4a", + suggestion_bg_hover: "#f5e6f5", + suggestion_bg_selected: "#e8d4e8", + suggestion_text_selected: "#2a2a2a", + scrollbar_track: "#fdfafd", + scrollbar_thumb: "#e8d4e8", + scrollbar_thumb_hover: "#d8b4d8", + }, + "light" => Theme { + background: "#f5f5f5", + editor_bg: "#fcfcfc", + editor_bg_focus: "#ffffff", + text: "#2c2c2c", + popup_bg: "#fcfcfc", + popup_border: "#e0e0e0", + popup_shadow: "rgba(0, 0, 0, 0.1)", + suggestion_text: "#2c2c2c", + suggestion_bg_hover: "#f0f0f0", + suggestion_bg_selected: "#e0e0e0", + suggestion_text_selected: "#1a1a1a", + scrollbar_track: "#fcfcfc", + scrollbar_thumb: "#e0e0e0", + scrollbar_thumb_hover: "#d0d0d0", + }, "dracula" => Theme { background: "#282a36", editor_bg: "#1e1f29", diff --git a/src/ui.rs b/src/ui.rs index b61bcb7..83976d9 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -30,6 +30,8 @@ pub fn create_preferences_window(config: Rc>, main_webview: WebV "Nord", "Monokai", "Solarized Dark", + "Pastel", + "Light", ] { theme_combo.append_text(theme); } @@ -39,6 +41,8 @@ pub fn create_preferences_window(config: Rc>, main_webview: WebV "nord" => 2, "monokai" => 3, "solarized-dark" => 4, + "pastel" => 5, + "light" => 6, _ => 0, }; theme_combo.set_active(Some(active_index)); @@ -128,6 +132,8 @@ pub fn create_preferences_window(config: Rc>, main_webview: WebV "Nord" => "nord", "Monokai" => "monokai", "Solarized Dark" => "solarized-dark", + "Pastel" => "pastel", + "Light" => "light", _ => "tokyo-night", } .to_string();