feat(explore): add focus indicator

pull/9/head
wongjiahau 1 year ago
parent 64059fba47
commit 2a60662e8b

@ -509,12 +509,18 @@ impl Explorer {
} }
fn render_tree(&mut self, area: Rect, surface: &mut Surface, cx: &mut Context) { fn render_tree(&mut self, area: Rect, surface: &mut Surface, cx: &mut Context) {
let title_style = cx.editor.theme.get("ui.text");
let title_style = if self.is_focus() {
title_style.add_modifier(Modifier::BOLD)
} else {
title_style
};
surface.set_stringn( surface.set_stringn(
area.x, area.x,
area.y, area.y,
"Explorer: press ? for help", "Explorer: press ? for help",
area.width.into(), area.width.into(),
cx.editor.theme.get("ui.text"), title_style,
); );
surface.set_stringn( surface.set_stringn(
area.x, area.x,

Loading…
Cancel
Save