Skip to content

Commit

Permalink
Merge pull request #91326 from aaronp64/line_edit_min_size
Browse files Browse the repository at this point in the history
Update `LineEdit` to include `read_only` StyleBox in `get_minimum_size()`
  • Loading branch information
akien-mga committed May 7, 2024
2 parents 86fb866 + 3337c16 commit 472273f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scene/gui/line_edit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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() {
Expand Down

0 comments on commit 472273f

Please sign in to comment.