Merge pull request #35140 from timothyqiu/line-edit-min-size

Updates LineEdit's min size when necessary
This commit is contained in:
Rémi Verschelde 2020-01-15 08:43:45 +01:00 committed by GitHub
commit bab91bd943
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -1239,6 +1239,11 @@ void LineEdit::set_text(String p_text) {
clear_internal(); clear_internal();
append_at_cursor(p_text); append_at_cursor(p_text);
if (expand_to_text_length) {
minimum_size_changed();
}
update(); update();
cursor_pos = 0; cursor_pos = 0;
window_pos = 0; window_pos = 0;
@ -1482,6 +1487,7 @@ void LineEdit::set_editable(bool p_editable) {
editable = p_editable; editable = p_editable;
_generate_context_menu(); _generate_context_menu();
minimum_size_changed();
update(); update();
} }
@ -1617,7 +1623,11 @@ bool LineEdit::get_expand_to_text_length() const {
} }
void LineEdit::set_clear_button_enabled(bool p_enabled) { void LineEdit::set_clear_button_enabled(bool p_enabled) {
if (clear_button_enabled == p_enabled) {
return;
}
clear_button_enabled = p_enabled; clear_button_enabled = p_enabled;
minimum_size_changed();
update(); update();
} }
@ -1653,6 +1663,7 @@ void LineEdit::set_right_icon(const Ref<Texture> &p_icon) {
return; return;
} }
right_icon = p_icon; right_icon = p_icon;
minimum_size_changed();
update(); update();
} }