on master help sign in
Change help prompt styling
commita2147fc7d56f9f5cb614d8c80b154a545dd59f00 authorBlaž Hrastnik <blaz@mxxn.io> dateTue 1 Jun 2021, 12:00 (5 years ago) parentd8e1655
2 files changed+9−9
helix-term/src/ui/prompt.rs+5−8 theme.toml+4−1
helix-term/src/ui/prompt.rs+5−8
@@ -111,6 +111,7 @@ impl Prompt {
111111 pub fn render_prompt(&self, area: Rect, surface: &mut Surface, cx: &mut Context) {
112112 let theme = &cx.editor.theme;
113113 let text_color = theme.get("ui.text.focus");
114+ let selected_color = theme.get("ui.menu.selected");
114115 // completion
115116
116117 let max_col = area.width / BASE_WIDTH;
@@ -133,7 +134,8 @@ impl Prompt {
133134
134135 for (i, (_range, completion)) in self.completion.iter().enumerate() {
135136 let color = if Some(i) == self.selection {
136− Style::default().bg(Color::Rgb(104, 60, 232))
137+ // Style::default().bg(Color::Rgb(104, 60, 232))
138+ selected_color // TODO: just invert bg
137139 } else {
138140 text_color
139141 };
@@ -158,14 +160,9 @@ impl Prompt {
158160 if let Some(doc) = (self.doc_fn)(&self.line) {
159161 let text = ui::Text::new(doc.to_string());
160162
161− let area = Rect::new(
162− completion_area.x,
163− completion_area.y - 3,
164− completion_area.width,
165− 3,
166− );
163+ let area = Rect::new(completion_area.x, completion_area.y - 3, BASE_WIDTH * 3, 3);
167164
168− let background = theme.get("ui.window");
165+ let background = theme.get("ui.help");
169166 surface.clear_with(area, background);
170167
171168 use tui::layout::Margin;
theme.toml+4−1
@@ -43,8 +43,11 @@
4343"ui.statusline" = { bg = "#281733" } # revolver
4444"ui.popup" = { bg = "#281733" } # revolver
4545"ui.window" = { bg = "#452859" } # bossa nova
46+"ui.window" = { bg = "#452859" } # bossa nova
47+"ui.help" = { bg = "#6F44F0", fg = "#a4a0e8" }
48+"ui.help" = { bg = "#7958DC", fg = "#171452" }
4649
47−"ui.text" = { fg = "#a4a0e8"} # lavender
50+"ui.text" = { fg = "#a4a0e8" } # lavender
4851"ui.text.focus" = { fg = "#dbbfef"} # lilac
4952
5053"ui.menu.selected" = { fg = "#281733", bg = "#ffffff" } # revolver