diff options
| author | reduz <reduzio@gmail.com> | 2021-02-12 11:05:10 -0300 |
|---|---|---|
| committer | Juan Linietsky <reduzio@gmail.com> | 2021-02-12 17:04:38 +0100 |
| commit | 28537d8c84a03bf88e99f3cae0ca5ded0fc95df6 (patch) | |
| tree | cdb7b5a85d71a3cafb890ef261783c19670ff43b /scene/gui/line_edit.cpp | |
| parent | 5e528f35505ba946cbda5f7c1fc800ed578b52dc (diff) | |
| download | redot-engine-28537d8c84a03bf88e99f3cae0ca5ded0fc95df6.tar.gz | |
Fix LineEdit minimum width
-Changed theme setting name to make more sense of what it does
-Reduced amount of minimum characters, so minimum size is smaller.
Diffstat (limited to 'scene/gui/line_edit.cpp')
| -rw-r--r-- | scene/gui/line_edit.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/scene/gui/line_edit.cpp b/scene/gui/line_edit.cpp index 14c84eb256..654507b933 100644 --- a/scene/gui/line_edit.cpp +++ b/scene/gui/line_edit.cpp @@ -1568,12 +1568,12 @@ Size2 LineEdit::get_minimum_size() const { Size2 min_size; // Minimum size of text. - int space_size = font->get_char_size(' ', 0, font_size).x; - min_size.width = get_theme_constant("minimum_spaces") * space_size; + int em_space_size = font->get_char_size('M', 0, font_size).x; + min_size.width = get_theme_constant("minimum_character_width'") * em_space_size; if (expand_to_text_length) { // Add a space because some fonts are too exact, and because cursor needs a bit more when at the end. - min_size.width = MAX(min_size.width, full_width + space_size); + min_size.width = MAX(min_size.width, full_width + em_space_size); } min_size.height = MAX(TS->shaped_text_get_size(text_rid).y + font->get_spacing(Font::SPACING_TOP) + font->get_spacing(Font::SPACING_BOTTOM), font->get_height(font_size)); |
