Fixed text rendering color based on focus
This commit is contained in:
parent
761b211e89
commit
a24e5b128c
1 changed files with 8 additions and 1 deletions
|
@ -647,6 +647,13 @@ impl Element for TerminalEl {
|
||||||
let cursor_point = DisplayCursor::from(cursor.point, display_offset);
|
let cursor_point = DisplayCursor::from(cursor.point, display_offset);
|
||||||
let cursor_text = {
|
let cursor_text = {
|
||||||
let str_trxt = cursor_text.to_string();
|
let str_trxt = cursor_text.to_string();
|
||||||
|
|
||||||
|
let color = if self.focused {
|
||||||
|
terminal_theme.colors.background
|
||||||
|
} else {
|
||||||
|
terminal_theme.colors.foreground
|
||||||
|
};
|
||||||
|
|
||||||
cx.text_layout_cache.layout_str(
|
cx.text_layout_cache.layout_str(
|
||||||
&str_trxt,
|
&str_trxt,
|
||||||
text_style.font_size,
|
text_style.font_size,
|
||||||
|
@ -654,7 +661,7 @@ impl Element for TerminalEl {
|
||||||
str_trxt.len(),
|
str_trxt.len(),
|
||||||
RunStyle {
|
RunStyle {
|
||||||
font_id: text_style.font_id,
|
font_id: text_style.font_id,
|
||||||
color: terminal_theme.colors.background,
|
color,
|
||||||
underline: Default::default(),
|
underline: Default::default(),
|
||||||
},
|
},
|
||||||
)],
|
)],
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue