From 43b0e054bef88558a9b7f5da21272fcc601f9cc7 Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Sun, 5 Jun 2022 16:22:01 -0300 Subject: [PATCH] Take into account the clear icon's size even when not visible in `LineEdit`s --- scene/gui/line_edit.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 42f8306a981..c3cf6504700 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -1563,7 +1563,7 @@ Size2 LineEdit::get_minimum_size() const { min_size.height = font->get_height(); // Take icons into account. - if (!text.empty() && is_editable() && clear_button_enabled) { + if (clear_button_enabled) { min_size.width = MAX(min_size.width, Control::get_icon("clear")->get_width()); min_size.height = MAX(min_size.height, Control::get_icon("clear")->get_height()); }