diff options
author | kobewi <kobewi4e@gmail.com> | 2021-05-07 17:39:55 +0200 |
---|---|---|
committer | kobewi <kobewi4e@gmail.com> | 2021-05-07 23:08:00 +0200 |
commit | c3967c80abd2078f0996761faed256a33cf38d97 (patch) | |
tree | 14cfe44eb983b4690d0f531b330dc1ff2ef42152 | |
parent | 8976594f4b90edd42a926e483815c829a540d8d2 (diff) | |
download | redot-engine-c3967c80abd2078f0996761faed256a33cf38d97.tar.gz |
Display arrow cursor if text is not editable
-rw-r--r-- | scene/gui/line_edit.cpp | 2 | ||||
-rw-r--r-- | scene/gui/text_edit.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index eb836b3bf7..bfd739788f 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -557,7 +557,7 @@ void LineEdit::drop_data(const Point2 &p_point, const Variant &p_data) { } Control::CursorShape LineEdit::get_cursor_shape(const Point2 &p_pos) const { - if (!text.is_empty() && is_editable() && _is_over_clear_button(p_pos)) { + if ((!text.is_empty() && is_editable() && _is_over_clear_button(p_pos)) || (!is_editable() && (!is_selecting_enabled() || text.is_empty()))) { return CURSOR_ARROW; } return Control::get_cursor_shape(p_pos); diff --git a/scene/gui/text_edit.cpp b/scene/gui/text_edit.cpp index ded912591f..c924f89709 100644 --- a/scene/gui/text_edit.cpp +++ b/scene/gui/text_edit.cpp @@ -4450,7 +4450,7 @@ Control::CursorShape TextEdit::get_cursor_shape(const Point2 &p_pos) const { return CURSOR_POINTING_HAND; } - if ((completion_active && completion_rect.has_point(p_pos))) { + if ((completion_active && completion_rect.has_point(p_pos)) || (is_readonly() && (!is_selecting_enabled() || text.size() == 0))) { return CURSOR_ARROW; } |