summaryrefslogtreecommitdiff
path: root/scene/gui/line_edit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/line_edit.cpp')
-rw-r--r--scene/gui/line_edit.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp
index 9abf9649c0..8bb6828fa6 100644
--- a/scene/gui/line_edit.cpp
+++ b/scene/gui/line_edit.cpp
@@ -576,7 +576,7 @@ void LineEdit::_notification(int p_what) {
RID ci = get_canvas_item();
- Ref<StyleBox> style = get_stylebox("normal");
+ Ref<StyleBox> style = has_focus() ? get_stylebox("active") : get_stylebox("normal");
if (!is_editable())
style = get_stylebox("read_only");
@@ -617,7 +617,7 @@ void LineEdit::_notification(int p_what) {
int font_ascent = font->get_ascent();
Color selection_color = get_color("selection_color");
- Color font_color = get_color("font_color");
+ Color font_color = is_editable() ? has_focus() ? get_color("font_color_active") : get_color("font_color") : get_color("font_color_read_only");
Color font_color_selected = get_color("font_color_selected");
Color cursor_color = get_color("cursor_color");
@@ -633,8 +633,8 @@ void LineEdit::_notification(int p_what) {
if (char_ofs >= t.length())
break;
- CharType cchar = pass ? '*' : t[char_ofs];
- CharType next = pass ? '*' : t[char_ofs + 1];
+ CharType cchar = (pass && !text.empty()) ? '*' : t[char_ofs];
+ CharType next = (pass && !text.empty()) ? '*' : t[char_ofs + 1];
int char_width = font->get_char_size(cchar, next).width;
// end of widget, break!