diff options
author | Sergey Bugaev <bugaevc@gmail.com> | 2019-09-21 00:45:00 +0300 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-28 18:29:42 +0200 |
commit | dd5541fefc2763368627d8e6e39e93eeead36000 (patch) | |
tree | 008b609d63d1e9288e0297ffc663df33624729b1 | |
parent | 3652bec7467c182744c6a1ada6f9983cee1cbc5f (diff) | |
download | serenity-dd5541fefc2763368627d8e6e39e93eeead36000.zip |
Terminal: Add underline support
-rw-r--r-- | Applications/Terminal/TerminalWidget.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Applications/Terminal/TerminalWidget.cpp b/Applications/Terminal/TerminalWidget.cpp index 4ab16c1520..2a3216af62 100644 --- a/Applications/Terminal/TerminalWidget.cpp +++ b/Applications/Terminal/TerminalWidget.cpp @@ -266,10 +266,12 @@ void TerminalWidget::paint_event(GPaintEvent& event) should_reverse_fill_for_cursor_or_selection |= selection_contains({ row, column }); attribute = line.attributes[column]; auto character_rect = glyph_rect(row, column); + auto cell_rect = character_rect.inflated(0, m_line_spacing); if (!has_only_one_background_color || should_reverse_fill_for_cursor_or_selection) { - auto cell_rect = character_rect.inflated(0, m_line_spacing); 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 == ' ') |