diff options
| author | Rémi Verschelde | 2017-07-17 22:36:00 +0200 |
|---|---|---|
| committer | GitHub | 2017-07-17 22:36:00 +0200 |
| commit | 2b8342e308762d8621b8866669797f9fab2da873 (patch) | |
| tree | a419f3d0bdb347169554633b60798db848afb7a6 /scene/gui/line_edit.cpp | |
| parent | 1c1d43ef214f6a8132e8c9a708bf11c0c0192f81 (diff) | |
| parent | a3c2d9a6bdbe3967c8f747e39b2b581729b492c1 (diff) | |
| download | godot-2b8342e308762d8621b8866669797f9fab2da873.tar.gz godot-2b8342e308762d8621b8866669797f9fab2da873.tar.zst godot-2b8342e308762d8621b8866669797f9fab2da873.zip | |
Diffstat (limited to 'scene/gui/line_edit.cpp')
| -rw-r--r-- | scene/gui/line_edit.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index a418444bc..adcf86357 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -574,8 +574,12 @@ void LineEdit::_notification(int p_what) { RID ci = get_canvas_item(); Ref<StyleBox> style = get_stylebox("normal"); - if (!is_editable()) + float disabled_alpha = 1.0; // used to set the disabled input text color + if (!is_editable()) { style = get_stylebox("read_only"); + disabled_alpha = .5; + draw_caret = false; + } Ref<Font> font = get_font("font"); @@ -622,6 +626,7 @@ void LineEdit::_notification(int p_what) { // draw placeholder color if (text.empty()) font_color.a *= placeholder_alpha; + font_color.a *= disabled_alpha; int caret_height = font->get_height() > y_area ? y_area : font->get_height(); while (true) { |
