From f6443beade093a1413e87c53fb9821e5e25c859f Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Sat, 13 Nov 2021 23:06:47 +0100 Subject: Add a theme constant to change LineEdit and TextEdit's caret width This can be useful to improve caret visibility, especially at larger font sizes. This can also be used for accessibility purposes. --- scene/resources/default_theme/default_theme.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scene/resources') diff --git a/scene/resources/default_theme/default_theme.cpp b/scene/resources/default_theme/default_theme.cpp index 549bd3ba12..ba7f882530 100644 --- a/scene/resources/default_theme/default_theme.cpp +++ b/scene/resources/default_theme/default_theme.cpp @@ -407,6 +407,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_constant("minimum_character_width", "LineEdit", 4); theme->set_constant("outline_size", "LineEdit", 0); + theme->set_constant("caret_width", "LineEdit", 1); theme->set_icon("clear", "LineEdit", make_icon(line_edit_clear_png)); @@ -451,6 +452,7 @@ void fill_default_theme(Ref &theme, const Ref &default_font, const theme->set_constant("line_spacing", "TextEdit", 4 * scale); theme->set_constant("outline_size", "TextEdit", 0); + theme->set_constant("caret_width", "TextEdit", 1); // CodeEdit -- cgit v1.2.3