diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-08-03 08:02:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-03 08:02:20 +0200 |
commit | 26481cff952f4433e265738ebe6d16e393f63105 (patch) | |
tree | 368a720b4d2297a367f496c1b53e865af84b48ea | |
parent | 04703c6f66be07e4ee305407713ad14a18e19ce3 (diff) | |
parent | 3ea3addc79038a47d0aef783455752aef5cb11c8 (diff) |
Merge pull request #51198 from Calinou/codeedit-improve-callhint-highlight
Improve CodeEdit's callhint highlight visibility
-rw-r--r-- | scene/gui/code_edit.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scene/gui/code_edit.cpp b/scene/gui/code_edit.cpp index 45d74c631a..32922f609d 100644 --- a/scene/gui/code_edit.cpp +++ b/scene/gui/code_edit.cpp @@ -225,8 +225,15 @@ void CodeEdit::_notification(int p_what) { round_ofs = round_ofs.round(); draw_string(font, round_ofs, line.replace(String::chr(0xFFFF), ""), HALIGN_LEFT, -1, cache.font_size, font_color); if (end > 0) { - Vector2 b = hint_ofs + sb->get_offset() + Vector2(begin, font_height + font_height * i + line_spacing - 1); - draw_line(b, b + Vector2(end - begin, 0), font_color); + // Draw an underline for the currently edited function parameter. + const Vector2 b = hint_ofs + sb->get_offset() + Vector2(begin, font_height + font_height * i + line_spacing); + draw_line(b, b + Vector2(end - begin, 0), font_color, 2); + + // Draw a translucent text highlight as well. + const Rect2 highlight_rect = Rect2( + hint_ofs + sb->get_offset() + Vector2(begin, 0), + Vector2(end - begin, font_height)); + draw_rect(highlight_rect, font_color * Color(1, 1, 1, 0.2)); } line_spacing += cache.line_spacing; } |