on master help sign in
info component style config use ui.info ui.info.text (#643)
490125fCossonLeo
helix-term/src/ui/info.rs+6−2
@@ -6,8 +6,12 @@ use tui::widgets::{Block, Borders, Paragraph, Widget};
6
6
7impl Component for Info {
7impl Component for Info {
8 fn render(&mut self, viewport: Rect, surface: &mut Surface, cx: &mut Context) {
8 fn render(&mut self, viewport: Rect, surface: &mut Surface, cx: &mut Context) {
9+ let get_theme = |style, fallback| {
9− let text_style = cx.editor.theme.get("ui.text.focus");
10+ let theme = &cx.editor.theme;
11+ theme.try_get(style).unwrap_or_else(|| theme.get(fallback))
12+ };
13+ let text_style = get_theme("ui.info.text", "ui.text");
10− let popup_style = text_style.patch(cx.editor.theme.get("ui.popup"));
14+ let popup_style = text_style.patch(get_theme("ui.info", "ui.popup"));
11
15
12 // Calculate the area of the terminal to modify. Because we want to
16 // Calculate the area of the terminal to modify. Because we want to
13 // render at the bottom right, we use the viewport's width and height
17 // render at the bottom right, we use the viewport's width and height