Merge pull request #91326 from aaronp64/line_edit_min_size

Update `LineEdit` to include `read_only` StyleBox in `get_minimum_size()`
This commit is contained in:
Rémi Verschelde 2024-05-07 13:48:44 +02:00
commit 472273f07a
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 2 deletions

View File

@ -1805,7 +1805,6 @@ void LineEdit::clear_internal() {
}
Size2 LineEdit::get_minimum_size() const {
Ref<StyleBox> style = theme_cache.normal;
Ref<Font> font = theme_cache.font;
int font_size = theme_cache.font_size;
@ -1834,7 +1833,8 @@ Size2 LineEdit::get_minimum_size() const {
}
min_size.width += icon_max_width;
return style->get_minimum_size() + min_size;
Size2 style_min_size = theme_cache.normal->get_minimum_size().max(theme_cache.read_only->get_minimum_size());
return style_min_size + min_size;
}
void LineEdit::deselect() {