on master help sign in
Change help prompt styling
a2147fcBlaž Hrastnik
helix-term/src/ui/prompt.rs+5−8
@@ -111,6 +111,7 @@ impl Prompt {
111 pub fn render_prompt(&self, area: Rect, surface: &mut Surface, cx: &mut Context) {
111 pub fn render_prompt(&self, area: Rect, surface: &mut Surface, cx: &mut Context) {
112 let theme = &cx.editor.theme;
112 let theme = &cx.editor.theme;
113 let text_color = theme.get("ui.text.focus");
113 let text_color = theme.get("ui.text.focus");
114+ let selected_color = theme.get("ui.menu.selected");
114 // completion
115 // completion
115
116
116 let max_col = area.width / BASE_WIDTH;
117 let max_col = area.width / BASE_WIDTH;
@@ -133,7 +134,8 @@ impl Prompt {
133
134
134 for (i, (_range, completion)) in self.completion.iter().enumerate() {
135 for (i, (_range, completion)) in self.completion.iter().enumerate() {
135 let color = if Some(i) == self.selection {
136 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
137 } else {
139 } else {
138 text_color
140 text_color
139 };
141 };
@@ -158,14 +160,9 @@ impl Prompt {
158 if let Some(doc) = (self.doc_fn)(&self.line) {
160 if let Some(doc) = (self.doc_fn)(&self.line) {
159 let text = ui::Text::new(doc.to_string());
161 let text = ui::Text::new(doc.to_string());
160
162
161− let area = Rect::new(
162− completion_area.x,
163− completion_area.y - 3,
163+ let area = Rect::new(completion_area.x, completion_area.y - 3, BASE_WIDTH * 3, 3);
164− completion_area.width,
165− 3,
166− );
167
164
168− let background = theme.get("ui.window");
165+ let background = theme.get("ui.help");
169 surface.clear_with(area, background);
166 surface.clear_with(area, background);
170
167
171 use tui::layout::Margin;
168 use tui::layout::Margin;
theme.toml+4−1
@@ -43,8 +43,11 @@
43"ui.statusline" = { bg = "#281733" } # revolver
43"ui.statusline" = { bg = "#281733" } # revolver
44"ui.popup" = { bg = "#281733" } # revolver
44"ui.popup" = { bg = "#281733" } # revolver
45"ui.window" = { bg = "#452859" } # bossa nova
45"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" }
46
49
47−"ui.text" = { fg = "#a4a0e8"} # lavender
50+"ui.text" = { fg = "#a4a0e8" } # lavender
48"ui.text.focus" = { fg = "#dbbfef"} # lilac
51"ui.text.focus" = { fg = "#dbbfef"} # lilac
49
52
50"ui.menu.selected" = { fg = "#281733", bg = "#ffffff" } # revolver
53"ui.menu.selected" = { fg = "#281733", bg = "#ffffff" } # revolver