ui/themes: make theme_default the default for other keys
parent
eef007600b
commit
42747ef590
|
@ -205,7 +205,7 @@ pub struct ThemeAttribute {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Holds {fore,back}ground color and terminal attribute values.
|
/// Holds {fore,back}ground color and terminal attribute values.
|
||||||
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
pub struct ThemeAttributeInner {
|
pub struct ThemeAttributeInner {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
fg: ThemeValue<Color>,
|
fg: ThemeValue<Color>,
|
||||||
|
@ -215,6 +215,16 @@ pub struct ThemeAttributeInner {
|
||||||
attrs: ThemeValue<Attr>,
|
attrs: ThemeValue<Attr>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl Default for ThemeAttributeInner {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self {
|
||||||
|
fg: "theme_default".into(),
|
||||||
|
bg: "theme_default".into(),
|
||||||
|
attrs: "theme_default".into(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
/// Holds either an actual value or refers to the key name of the attribute that holds the value.
|
/// Holds either an actual value or refers to the key name of the attribute that holds the value.
|
||||||
pub enum ThemeValue<T> {
|
pub enum ThemeValue<T> {
|
||||||
|
@ -459,7 +469,7 @@ impl Default for Theme {
|
||||||
dark.insert($key.into(), ThemeAttributeInner::default());
|
dark.insert($key.into(), ThemeAttributeInner::default());
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
add!("theme_default");
|
add!("theme_default", dark = { fg: Color::Default, bg: Color::Default, attrs: Attr::Default }, light = { fg: Color::Default, bg: Color::Default, attrs: Attr::Default });
|
||||||
add!("status.bar", dark = { fg: Color::Byte(123), bg: Color::Byte(26) }, light = { fg: Color::Byte(123), bg: Color::Byte(26) });
|
add!("status.bar", dark = { fg: Color::Byte(123), bg: Color::Byte(26) }, light = { fg: Color::Byte(123), bg: Color::Byte(26) });
|
||||||
add!("status.notification", dark = { fg: Color::Byte(219), bg: Color::Byte(88) }, light = { fg: Color::Byte(219), bg: Color::Byte(88) });
|
add!("status.notification", dark = { fg: Color::Byte(219), bg: Color::Byte(88) }, light = { fg: Color::Byte(219), bg: Color::Byte(88) });
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue