Skip to content

Commit

Permalink
Add ui.statusline.inactive, use ui.statusline for statusline text
Browse files Browse the repository at this point in the history
  • Loading branch information
vv9k authored and CBenoit committed Jun 18, 2021
1 parent b052223 commit 1c1474c
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
5 changes: 3 additions & 2 deletions contrib/themes/bogster.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,16 @@
"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" }

"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"
Expand Down
3 changes: 2 additions & 1 deletion contrib/themes/ingrid.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
1 change: 1 addition & 0 deletions contrib/themes/onedark.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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'] }
Expand Down
17 changes: 7 additions & 10 deletions helix-term/src/ui/editor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -499,7 +496,7 @@ impl EditorView {
viewport.y,
title,
viewport.width.saturating_sub(6) as usize,
text_color,
style,
);
}

Expand Down Expand Up @@ -538,7 +535,7 @@ impl EditorView {
viewport.x + viewport.width.saturating_sub(text_len),
viewport.y,
right_side_text,
text_color,
style,
);
}

Expand Down
3 changes: 2 additions & 1 deletion theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 1c1474c

Please sign in to comment.