|
|
@ -6,12 +6,8 @@ use tui::widgets::{Block, Borders, Paragraph, Widget};
|
|
|
|
|
|
|
|
|
|
|
|
impl Component for Info {
|
|
|
|
impl Component for Info {
|
|
|
|
fn render(&mut self, viewport: Rect, surface: &mut Surface, cx: &mut Context) {
|
|
|
|
fn render(&mut self, viewport: Rect, surface: &mut Surface, cx: &mut Context) {
|
|
|
|
let get_theme = |style, fallback| {
|
|
|
|
let text_style = cx.editor.theme.get("ui.text.info");
|
|
|
|
let theme = &cx.editor.theme;
|
|
|
|
let popup_style = cx.editor.theme.get("ui.popup.info");
|
|
|
|
theme.try_get(style).unwrap_or_else(|| theme.get(fallback))
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
let text_style = get_theme("ui.info.text", "ui.text");
|
|
|
|
|
|
|
|
let popup_style = text_style.patch(get_theme("ui.info", "ui.popup"));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Calculate the area of the terminal to modify. Because we want to
|
|
|
|
// Calculate the area of the terminal to modify. Because we want to
|
|
|
|
// render at the bottom right, we use the viewport's width and height
|
|
|
|
// render at the bottom right, we use the viewport's width and height
|
|
|
|