mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 05:37:34 +00:00
Terminal: Add underline support
This commit is contained in:
parent
3652bec746
commit
dd5541fefc
1 changed files with 3 additions and 1 deletions
|
@ -266,10 +266,12 @@ void TerminalWidget::paint_event(GPaintEvent& event)
|
||||||
should_reverse_fill_for_cursor_or_selection |= selection_contains({ row, column });
|
should_reverse_fill_for_cursor_or_selection |= selection_contains({ row, column });
|
||||||
attribute = line.attributes[column];
|
attribute = line.attributes[column];
|
||||||
auto character_rect = glyph_rect(row, column);
|
auto character_rect = glyph_rect(row, column);
|
||||||
if (!has_only_one_background_color || should_reverse_fill_for_cursor_or_selection) {
|
|
||||||
auto cell_rect = character_rect.inflated(0, m_line_spacing);
|
auto cell_rect = character_rect.inflated(0, m_line_spacing);
|
||||||
|
if (!has_only_one_background_color || should_reverse_fill_for_cursor_or_selection) {
|
||||||
painter.fill_rect(cell_rect, lookup_color(should_reverse_fill_for_cursor_or_selection ? attribute.foreground_color : attribute.background_color).with_alpha(m_opacity));
|
painter.fill_rect(cell_rect, lookup_color(should_reverse_fill_for_cursor_or_selection ? attribute.foreground_color : attribute.background_color).with_alpha(m_opacity));
|
||||||
}
|
}
|
||||||
|
if (attribute.flags & VT::Attribute::Underline)
|
||||||
|
painter.draw_line(cell_rect.bottom_left(), cell_rect.bottom_right(), lookup_color(should_reverse_fill_for_cursor_or_selection ? attribute.background_color : attribute.foreground_color));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (codepoint == ' ')
|
if (codepoint == ' ')
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue