summaryrefslogtreecommitdiff
path: root/Libraries/LibWeb/Layout
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-12-09 21:19:40 +0100
committerAndreas Kling <kling@serenityos.org>2020-12-10 11:39:47 +0100
commit350b2c6d9e88b9f1d5e2cf2c01db2ffc64fa086e (patch)
tree8072c90417a410ec0ceb272ec3db84fb487b9afd /Libraries/LibWeb/Layout
parent5d77a19af5508be4346458c2b598b508c53167ad (diff)
downloadserenity-350b2c6d9e88b9f1d5e2cf2c01db2ffc64fa086e.zip
LibWeb: Use the surrounding text color as the caret color
This way you can always see the cursor as long (as you can see the text you are editing.)
Diffstat (limited to 'Libraries/LibWeb/Layout')
-rw-r--r--Libraries/LibWeb/Layout/TextNode.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/Libraries/LibWeb/Layout/TextNode.cpp b/Libraries/LibWeb/Layout/TextNode.cpp
index a4f59874a4..0ae4546cbb 100644
--- a/Libraries/LibWeb/Layout/TextNode.cpp
+++ b/Libraries/LibWeb/Layout/TextNode.cpp
@@ -134,7 +134,9 @@ void TextNode::paint_cursor_if_needed(PaintContext& context, const LineBoxFragme
float cursor_top = fragment_rect.top();
float cursor_height = fragment_rect.height();
Gfx::IntRect cursor_rect(cursor_x, cursor_top, 1, cursor_height);
- context.painter().draw_rect(cursor_rect, context.palette().text_cursor());
+
+ auto color = specified_style().color_or_fallback(CSS::PropertyID::Color, document(), context.palette().base_text());
+ context.painter().draw_rect(cursor_rect, color);
}
template<typename Callback>