v0.2.14 : cadres aux couleurs du theme - bordures des tableaux (list, search, status, doctor, ls, dir, ps, help), version, menu d autocompletion et banniere colorees par theme (border)
This commit is contained in:
+21
-1
@@ -19,8 +19,10 @@ pub struct Theme {
|
||||
pub accent: &'static str,
|
||||
/// Secondary color: types, values, status "installed".
|
||||
pub info: &'static str,
|
||||
/// Faint: borders, search terms, "not-installed".
|
||||
/// Faint: search terms, secondary text, "not-installed".
|
||||
pub dim: &'static str,
|
||||
/// Frame color: the borders of tables and boxes (list, version, ls...).
|
||||
pub border: &'static str,
|
||||
/// Warnings and "external" status.
|
||||
pub warn: &'static str,
|
||||
/// Errors and "not-installable".
|
||||
@@ -41,6 +43,7 @@ pub static THEMES: &[Theme] = &[
|
||||
accent: "1;32",
|
||||
info: "36",
|
||||
dim: "2",
|
||||
border: "36",
|
||||
warn: "33",
|
||||
error: "31",
|
||||
ok: "1;32",
|
||||
@@ -54,6 +57,7 @@ pub static THEMES: &[Theme] = &[
|
||||
accent: "1;38;5;81",
|
||||
info: "38;5;117",
|
||||
dim: "2",
|
||||
border: "38;5;75",
|
||||
warn: "38;5;221",
|
||||
error: "38;5;203",
|
||||
ok: "1;38;5;81",
|
||||
@@ -67,6 +71,7 @@ pub static THEMES: &[Theme] = &[
|
||||
accent: "1;38;5;215",
|
||||
info: "38;5;213",
|
||||
dim: "2",
|
||||
border: "38;5;209",
|
||||
warn: "38;5;221",
|
||||
error: "38;5;203",
|
||||
ok: "1;38;5;215",
|
||||
@@ -80,6 +85,7 @@ pub static THEMES: &[Theme] = &[
|
||||
accent: "1;38;5;107",
|
||||
info: "38;5;72",
|
||||
dim: "2",
|
||||
border: "38;5;71",
|
||||
warn: "38;5;179",
|
||||
error: "38;5;167",
|
||||
ok: "1;38;5;107",
|
||||
@@ -93,6 +99,7 @@ pub static THEMES: &[Theme] = &[
|
||||
accent: "1;38;5;84",
|
||||
info: "38;5;117",
|
||||
dim: "2",
|
||||
border: "38;5;141",
|
||||
warn: "38;5;228",
|
||||
error: "38;5;203",
|
||||
ok: "1;38;5;84",
|
||||
@@ -106,6 +113,7 @@ pub static THEMES: &[Theme] = &[
|
||||
accent: "",
|
||||
info: "",
|
||||
dim: "",
|
||||
border: "",
|
||||
warn: "",
|
||||
error: "",
|
||||
ok: "1",
|
||||
@@ -164,6 +172,10 @@ impl Theme {
|
||||
self.paint(self.dim, text)
|
||||
}
|
||||
|
||||
pub fn frame(&self, text: &str) -> String {
|
||||
self.paint(self.border, text)
|
||||
}
|
||||
|
||||
pub fn warn(&self, text: &str) -> String {
|
||||
self.paint(self.warn, text)
|
||||
}
|
||||
@@ -228,4 +240,12 @@ mod tests {
|
||||
assert!(!t.title.is_empty(), "{}: missing title", t.name);
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn frame_paints_with_the_theme_border_color() {
|
||||
let t = find("ocean").unwrap();
|
||||
let s = t.frame("╭──╮");
|
||||
assert!(s.starts_with("[38;5;75m"));
|
||||
assert_eq!(find("mono").unwrap().frame("x"), "x");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user