on master help sign in
info component style config use ui.info ui.info.text (#643)
commit490125f008f22be6150f95005bc081d680a69020 authorCossonLeo <20379044+cossonleo@users.noreply.github.com> dateTue 24 Aug 2021, 08:58 (5 years ago) parent1d45f50
1 file changed+6−2
helix-term/src/ui/info.rs+6−2
helix-term/src/ui/info.rs+6−2
@@ -6,8 +6,12 @@ use tui::widgets::{Block, Borders, Paragraph, Widget};
66
77impl Component for Info {
88 fn render(&mut self, viewport: Rect, surface: &mut Surface, cx: &mut Context) {
9− let text_style = cx.editor.theme.get("ui.text.focus");
10− let popup_style = text_style.patch(cx.editor.theme.get("ui.popup"));
9+ let get_theme = |style, fallback| {
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");
14+ let popup_style = text_style.patch(get_theme("ui.info", "ui.popup"));
1115
1216 // Calculate the area of the terminal to modify. Because we want to
1317 // render at the bottom right, we use the viewport's width and height