Skip to content

Commit

Permalink
[Add] Pastel and Light theme(s).
Browse files Browse the repository at this point in the history
  • Loading branch information
ali205412 committed Nov 21, 2024
1 parent 05ce192 commit 0f8ddf2
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 1 deletion.
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[theme]
name = "solarized-dark"
name = "light"

[font]
family = "IBM Plex Sans Arabic"
Expand Down
32 changes: 32 additions & 0 deletions src/themes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 6 additions & 0 deletions src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ pub fn create_preferences_window(config: Rc<RefCell<Config>>, main_webview: WebV
"Nord",
"Monokai",
"Solarized Dark",
"Pastel",
"Light",
] {
theme_combo.append_text(theme);
}
Expand All @@ -39,6 +41,8 @@ pub fn create_preferences_window(config: Rc<RefCell<Config>>, main_webview: WebV
"nord" => 2,
"monokai" => 3,
"solarized-dark" => 4,
"pastel" => 5,
"light" => 6,
_ => 0,
};
theme_combo.set_active(Some(active_index));
Expand Down Expand Up @@ -128,6 +132,8 @@ pub fn create_preferences_window(config: Rc<RefCell<Config>>, main_webview: WebV
"Nord" => "nord",
"Monokai" => "monokai",
"Solarized Dark" => "solarized-dark",
"Pastel" => "pastel",
"Light" => "light",
_ => "tokyo-night",
}
.to_string();
Expand Down

0 comments on commit 0f8ddf2

Please sign in to comment.