diff --git a/yazi-config/preset/theme-dark.toml b/yazi-config/preset/theme-dark.toml index 5d0669a0..0bfba887 100644 --- a/yazi-config/preset/theme-dark.toml +++ b/yazi-config/preset/theme-dark.toml @@ -20,11 +20,9 @@ light = "" [app] overall = {} - -[app.panes] -parent = "" -current = "" -preview = "" +parent = {} +current = {} +preview = {} # : }}} diff --git a/yazi-config/preset/theme-light.toml b/yazi-config/preset/theme-light.toml index 2070c514..629077c9 100644 --- a/yazi-config/preset/theme-light.toml +++ b/yazi-config/preset/theme-light.toml @@ -20,11 +20,9 @@ light = "" [app] overall = {} - -[app.panes] -parent = "" -current = "" -preview = "" +parent = {} +current = {} +preview = {} # : }}} diff --git a/yazi-config/src/theme/theme.rs b/yazi-config/src/theme/theme.rs index fff8fb6f..4c981718 100644 --- a/yazi-config/src/theme/theme.rs +++ b/yazi-config/src/theme/theme.rs @@ -37,11 +37,6 @@ pub struct Theme { #[derive(Deserialize, DeserializeOver2)] pub struct App { pub overall: Style, - pub panes: AppPanes, -} - -#[derive(Deserialize, DeserializeOver2)] -pub struct AppPanes { #[serde(default)] pub parent: Style, #[serde(default)] @@ -249,10 +244,10 @@ impl Theme { impl App { pub fn bg_color(&self) -> String { self.overall.bg.map(|c| c.to_string()).unwrap_or_default() } -} -impl AppPanes { pub fn parent_bg(&self) -> String { self.parent.bg.map(|c| c.to_string()).unwrap_or_default() } + pub fn current_bg(&self) -> String { self.current.bg.map(|c| c.to_string()).unwrap_or_default() } + pub fn preview_bg(&self) -> String { self.preview.bg.map(|c| c.to_string()).unwrap_or_default() } } diff --git a/yazi-fm/src/root.rs b/yazi-fm/src/root.rs index 8ec5782c..c2d08189 100644 --- a/yazi-fm/src/root.rs +++ b/yazi-fm/src/root.rs @@ -98,7 +98,7 @@ impl Widget for Root<'_> { // Apply pane backgrounds (if configured) // Skip borders: top/bottom rows and left/right edges where borders are drawn - let parent_bg = THEME.app.panes.parent_bg(); + let parent_bg = THEME.app.parent_bg(); if !parent_bg.is_empty() { if let Ok(bg_color) = parent_bg.parse::() { let pane = chunks[0]; @@ -117,7 +117,7 @@ impl Widget for Root<'_> { } } - let current_bg = THEME.app.panes.current_bg(); + let current_bg = THEME.app.current_bg(); if !current_bg.is_empty() { if let Ok(bg_color) = current_bg.parse::() { let pane = chunks[1]; @@ -134,7 +134,7 @@ impl Widget for Root<'_> { } } - let preview_bg = THEME.app.panes.preview_bg(); + let preview_bg = THEME.app.preview_bg(); if !preview_bg.is_empty() { if let Ok(bg_color) = preview_bg.parse::() { let pane = chunks[2]; diff --git a/yazi-plugin/src/theme/theme.rs b/yazi-plugin/src/theme/theme.rs index 1eaedcff..ff4da914 100644 --- a/yazi-plugin/src/theme/theme.rs +++ b/yazi-plugin/src/theme/theme.rs @@ -34,14 +34,9 @@ fn app() -> Composer { let a = &THEME.app; match key { b"overall" => Style::from(a.overall).into_lua(lua), - - b"panes" => lua - .create_table_from([ - ("parent", Style::from(a.panes.parent).into_lua(lua)?), - ("current", Style::from(a.panes.current).into_lua(lua)?), - ("preview", Style::from(a.panes.preview).into_lua(lua)?), - ])? - .into_lua(lua), + b"parent" => Style::from(a.parent).into_lua(lua), + b"current" => Style::from(a.current).into_lua(lua), + b"preview" => Style::from(a.preview).into_lua(lua), _ => Ok(Value::Nil), } }