Skip to content

Commit

Permalink
Fix caret_force_displayed
Browse files Browse the repository at this point in the history
  • Loading branch information
KoBeWi committed Mar 3, 2025
1 parent 4c311cb commit 6d2f18c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion doc/classes/LineEdit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
The caret's column position inside the [LineEdit]. When set, the text may scroll to accommodate it.
</member>
<member name="caret_force_displayed" type="bool" setter="set_caret_force_displayed" getter="is_caret_force_displayed" default="false">
If [code]true[/code], the [LineEdit] will always show the caret, even if focus is lost.
If [code]true[/code], the [LineEdit] will always show the caret, even if not editing or focus is lost.
</member>
<member name="caret_mid_grapheme" type="bool" setter="set_caret_mid_grapheme_enabled" getter="is_caret_mid_grapheme_enabled" default="false">
Allow moving caret, selecting and removing the individual composite character components.
Expand Down
2 changes: 1 addition & 1 deletion scene/gui/line_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1733,7 +1733,7 @@ void LineEdit::_validate_caret_can_draw() {
draw_caret = true;
caret_blink_timer = 0.0;
}
caret_can_draw = editing && (window_has_focus || (menu && menu->has_focus())) && (has_focus() || caret_force_displayed);
caret_can_draw = (caret_force_displayed && !is_part_of_edited_scene()) || (editing && (window_has_focus || (menu && menu->has_focus())) && has_focus());
}

void LineEdit::delete_char() {
Expand Down

0 comments on commit 6d2f18c

Please sign in to comment.