From 1c1474c3b8dbab8ca4b9a62220c079ddffb7ed9f Mon Sep 17 00:00:00 2001 From: wojciechkepka Date: Fri, 18 Jun 2021 20:22:15 +0200 Subject: [PATCH] Add `ui.statusline.inactive`, use `ui.statusline` for statusline text --- contrib/themes/bogster.toml | 5 +++-- contrib/themes/ingrid.toml | 3 ++- contrib/themes/onedark.toml | 1 + helix-term/src/ui/editor.rs | 17 +++++++---------- theme.toml | 3 ++- 5 files changed, 15 insertions(+), 14 deletions(-) diff --git a/contrib/themes/bogster.toml b/contrib/themes/bogster.toml index 205e464c..43b422f3 100644 --- a/contrib/themes/bogster.toml +++ b/contrib/themes/bogster.toml @@ -31,7 +31,8 @@ "ui.background" = { bg = "#161c23" } "ui.linenr" = { fg = "#415367" } "ui.linenr.selected" = { fg = "#e5ded6" } # TODO -"ui.statusline" = { bg = "#232d38" } +"ui.statusline" = { fg = "#e5ded6", bg = "#232d38" } +"ui.statusline.inactive" = { fg = "#c6b8ad", bg = "#232d38" } "ui.popup" = { bg = "#232d38" } "ui.window" = { bg = "#232d38" } "ui.help" = { bg = "#232d38", fg = "#e5ded6" } @@ -39,7 +40,7 @@ "ui.text" = { fg = "#e5ded6" } "ui.text.focus" = { fg = "#e5ded6", modifiers= ["bold"] } -"ui.selection" = { bg = "#540099" } +"ui.selection" = { bg = "#313f4e" } "ui.menu.selected" = { fg = "#e5ded6", bg = "#313f4e" } "warning" = "#dc7759" diff --git a/contrib/themes/ingrid.toml b/contrib/themes/ingrid.toml index da333fb8..d32a89d1 100644 --- a/contrib/themes/ingrid.toml +++ b/contrib/themes/ingrid.toml @@ -31,7 +31,8 @@ "ui.background" = { bg = "#FFFCFD" } "ui.linenr" = { fg = "#bbbbbb" } "ui.linenr.selected" = { fg = "#F3EAE9" } # TODO -"ui.statusline" = { bg = "#F3EAE9" } +"ui.statusline" = { fg = "#250E07", bg = "#F3EAE9" } +"ui.statusline.inactive" = { fg = "#7b91b3", bg = "#F3EAE9" } "ui.popup" = { bg = "#F3EAE9" } "ui.window" = { bg = "#D8B8B3" } "ui.help" = { bg = "#D8B8B3", fg = "#250E07" } diff --git a/contrib/themes/onedark.toml b/contrib/themes/onedark.toml index 4c13a217..65f26725 100644 --- a/contrib/themes/onedark.toml +++ b/contrib/themes/onedark.toml @@ -36,6 +36,7 @@ "ui.linenr.selected" = { fg = "#ABB2BF" } "ui.popup" = { bg = "#3E4452" } "ui.statusline" = { fg = "#ABB2BF", bg = "#2C323C" } +"ui.statusline.inactive" = { fg = "#ABB2Bf", bg = "#2C323C" } "ui.selection" = { bg = "#3E4452" } "ui.text" = { fg = "#ABB2BF", bg = "#282C34" } "ui.text.focus" = { fg = "#ABB2BF", bg = "#2C323C", modifiers = ['bold'] } diff --git a/helix-term/src/ui/editor.rs b/helix-term/src/ui/editor.rs index ba5e7574..3dc43d3f 100644 --- a/helix-term/src/ui/editor.rs +++ b/helix-term/src/ui/editor.rs @@ -476,18 +476,15 @@ impl EditorView { Mode::Select => "SEL", Mode::Normal => "NOR", }; - let text_color = if is_focused { - theme.get("ui.text.focus") + let style = if is_focused { + theme.get("ui.statusline") } else { - theme.get("ui.text") + theme.get("ui.statusline.inactive") }; // statusline - surface.set_style( - Rect::new(viewport.x, viewport.y, viewport.width, 1), - theme.get("ui.statusline"), - ); + surface.set_style(Rect::new(viewport.x, viewport.y, viewport.width, 1), style); if is_focused { - surface.set_string(viewport.x + 1, viewport.y, mode, text_color); + surface.set_string(viewport.x + 1, viewport.y, mode, style); } if let Some(path) = doc.relative_path() { @@ -499,7 +496,7 @@ impl EditorView { viewport.y, title, viewport.width.saturating_sub(6) as usize, - text_color, + style, ); } @@ -538,7 +535,7 @@ impl EditorView { viewport.x + viewport.width.saturating_sub(text_len), viewport.y, right_side_text, - text_color, + style, ); } diff --git a/theme.toml b/theme.toml index 903a5e26..a4f40267 100644 --- a/theme.toml +++ b/theme.toml @@ -41,7 +41,8 @@ "ui.background" = { bg = "#3b224c" } # midnight "ui.linenr" = { fg = "#5a5977" } # comet "ui.linenr.selected" = { fg = "#dbbfef" } # lilac -"ui.statusline" = { bg = "#281733" } # revolver +"ui.statusline" = { fg = "#dbbfef", bg = "#281733" } # revolver +"ui.statusline.inactive" = { fg = "#a4a0e8", bg = "#281733" } # revolver "ui.popup" = { bg = "#281733" } # revolver "ui.window" = { bg = "#452859" } # bossa nova "ui.window" = { bg = "#452859" } # bossa nova