Added a hollow mode to the cursor rendering code, for terminal lost focus

This commit is contained in:
Mikayla Maki 2022-08-15 18:27:26 -07:00
parent bba51c3ae6
commit b9c73127b4
2 changed files with 47 additions and 5 deletions

View file

@ -635,7 +635,7 @@ impl Element for TerminalEl {
.unwrap()
.update(cx.app, |terminal, mcx| {
terminal.set_size(dimensions);
terminal.render_lock(mcx, |content, cursor_text, style| {
terminal.render_lock(mcx, |content, cursor_text, blink_mode| {
let mut cells = vec![];
cells.extend(
content
@ -659,7 +659,7 @@ impl Element for TerminalEl {
content.cursor,
content.display_offset,
cursor_text,
style,
blink_mode,
)
})
});
@ -713,7 +713,7 @@ impl Element for TerminalEl {
let (shape, color) = if self.focused {
(CursorShape::Block, terminal_theme.colors.cursor)
} else {
(CursorShape::Underscore, terminal_theme.colors.foreground)
(CursorShape::Hollow, terminal_theme.colors.foreground)
};
Cursor::new(